导航:首页 > 编程大全 > 此单元格已更改尚未将更改提交到数据库

此单元格已更改尚未将更改提交到数据库

发布时间:2024-06-30 22:15:43

① Excel VBA锛孷BA绋嬪簭浠g爜鏀瑰彉鍥剧墖鍐呭

1.ALT+F11鎵撳紑VBE缂栬緫鍣锛屾柊寤轰竴涓妯″潡1锛岃緭鍏ュ備笅浠g爜锛

Sub picxz() '浠ユ彃鍏ュ浘鐗囨枃浠跺師鍚嶇О浣滀负鍥惧舰鍚嶇О锛屽崟鍏冩牸澶у皬涓哄熀鍑嗭紝渚濇″厛琛屾柟鍚戝啀鍒楁柟鍚戞彃鍏ワ紝鍗冲厛A1,A2....鍐岯1,B2....渚濇$被鎺

Dim picname As Variant, p As Shape, pname As String, stly, p1 As Shape, pnamewr As String, x As Byte, x1 As Byte, itop, ileft, iheight, iwidth, l As Long, h As Long

Const hs As Long = 65536 '姣忓垪鎵鑳芥彃鍏ュ浘鐗囩殑鏈澶т釜鏁

stly = vbQuestion & vbYesNo

l = -Int(-Sheets("鍥惧簱").Shapes.Count / hs) '鍒楀彿

h = Sheets("鍥惧簱").Shapes.Count - (l - 1) * hs '琛屽彿

picname = Application.GetOpenFilename(FileFilter:="鍥剧墖鏂囦欢 (*.jpg; *.gif;*.bmp),*.jpg; *.gif;*.bmp,鎵鏈夋枃浠(*.*),*.*", _

Title:="鍥剧墖閫夋嫨", MultiSelect:=False)

If picname <> False Then

pname = Split(Dir(picname), ".", 2)(0) '鍙栧浘鐗囨枃浠跺師鍚嶇О

pnamewr = pname

itop = Sheets("鍥惧簱").Cells(h, l).Top '纭瀹氬潗鏍

ileft = Sheets("鍥惧簱").Cells(h, l).Left

iheight = Sheets("鍥惧簱").Cells(h, l).Height '纭瀹氬ぇ灏

iwidth = Sheets("鍥惧簱").Cells(h, l).Width

For Each p In Sheets("鍥惧簱").Shapes

If p.Name = pname Then

x = MsgBox("鍙戠幇浣犵殑鍥惧簱涓宸茬粡瀛樺湪鍚屽悕鍥剧墖锛岃风‘瀹氭槸鍚︿负鏂板浘鐗囷紵", stly, "鍥剧墖閲嶅悕锛岃﹀憡锛")

If x = 7 Then

Exit Sub

Else

x1 = MsgBox("鎮ㄧ‘瀹氶渶瑕佹浛鎹㈠悕涓猴細銆" & pname & "銆嬬殑鍥剧墖鍚楋紵", stly, "鍥剧墖鏇挎崲,璀﹀憡锛")

If x1 = 6 Then

itop = Sheets("鍥惧簱").Shapes(pname).Top

ileft = Sheets("鍥惧簱").Shapes(pname).Left

iheight = Sheets("鍥惧簱").Shapes(pname).Height

iwidth = Sheets("鍥惧簱").Shapes(pname).Width

Sheets("鍥惧簱").Shapes(pname).Delete

Else

chongshu:

If pnamewr = "" Then

pnamewr = InputBox("鎮ㄥ皻鏈瀵瑰浘鐗囧懡鍚嶏紝闇瑕佹g‘鍛藉悕锛屾柟鑳芥彃鍏ユゅ浘鐗囷紒", "鍥剧墖鍛藉悕")

Else

pnamewr = InputBox("鎮ㄧ殑鍥惧簱宸茬粡瀛樺湪浠ャ" & pnamewr & "銆嬩负鍚嶇О鐨勫浘鐗囷紝闇瑕侀噸鏂板懡鍚嶏紝鏂硅兘鎻掑叆姝ゅ浘鐗囷紒", "鍥剧墖鍛藉悕")

End If

If pnamewr = "" Or pnamewr = pname Then

jinggao:

MsgBox "璀﹀憡锛佽緭鍏ヤ负绌烘垨涓哄悓鍚嶏紒璇风户缁杈撳叆", vbExclamation, "鍥剧墖鍛藉悕璀﹀憡锛"

GoTo chongshu

End If

For Each p1 In Sheets("鍥惧簱").Shapes

If p1.Name = pnamewr Then GoTo jinggao

Next

End If

End If

End If

Next

ActiveSheet.Pictures.Insert(picname).Select

With Selection.ShapeRange

.Name = pnamewr

.LockAspectRatio = msoFalse

.Top = itop

.Left = ileft

.Height = iheight

.Width = iwidth

.Rotation = 0#

End With

End If

End Sub

阅读全文

与此单元格已更改尚未将更改提交到数据库相关的资料

热点内容
窝窝app怎么样自动关 浏览:228
苹果电脑怎么用wps生成多个文件夹 浏览:309
苹果手机哪里有卖 浏览:83
app登录状态为什么不过期 浏览:160
win10创意者无法升级 浏览:59
如何查杀后门程序 浏览:498
定类数据可以用哪些描述统计方法 浏览:278
微信公众号阅读全文怎么跳转文件 浏览:935
迷你编程怎么免费进入 浏览:354
苹果应用设置密码 浏览:21
windowsmac共享文件夹 浏览:274
数据安全性和固态硬盘哪个好 浏览:433
word为什么图片不能旋转 浏览:732
qq上本机文件怎么删除不了怎么办 浏览:117
美食的视频app有哪些 浏览:251
买酒去什么网站 浏览:140
jsdivcss 浏览:103
js有序数字 浏览:694
ps可以置入什么文件 浏览:794
阿里巴巴集团您正在重置密码 浏览:248

友情链接