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

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

发布时间: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

阅读全文

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

热点内容
linux开机启动 浏览:637
哪个app有拼音乐 浏览:226
qq音乐微信朋友圈 浏览:542
手机文件里的word文档 浏览:348
手机微博旧版本 浏览:964
ps安装文件夹删除需要权限 浏览:289
怎么搜索手机中视频文件 浏览:232
java判断是偶数 浏览:860
java降序排序 浏览:739
ie9xp版本 浏览:718
哪些是通过计算机网络组网 浏览:265
iphone锁屏密码取消 浏览:41
win10怎么添加电脑账户 浏览:388
视频会议系统招标文件 浏览:588
iphone5s来电接听 浏览:549
微信升级版本后无法播放腾讯视频 浏览:482
卖场广告的app哪里下载 浏览:377
灵狐网络视频下载 浏览:7
javaapr 浏览:561
苹果se天线在哪 浏览:359

友情链接