本文介绍了运行时错误'1004':对象'_全局'的方法'范围'失败;简单复制和粘贴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我只是想简单的剪切和粘贴,将F:G中的范围转移到 D 中的空闲单元格,但是我不断收到该错误消息。我的代码在模块中,我不知道我做错了什么!全新的VBA。突出显示部分: Range(F& RowNum&:G& RowNum)。选择 Sub MoveCells(RowNum as Integer) 范围(F& RowNum&:G& RowNum)。选择 Selection.Cut 范围(D& RowNum)。选择 ActiveSheet.Paste End Sub 解决方案 范围(F& ; RowNum&:G& RowNum)。选择 ^ ^ ^ ^ | | | | Chr(147)Chr(34) F 是字符147.要表示字符串值,您必须使用字符34,如周围的那些:G 这通常在从网站复制/粘贴代码时发生。删除引号并手动重新写入以解决问题。 I'm just trying to do a simple cut and paste to shift ranges in F:G to an unoccupied cell in D but I keep getting that error message. My codes are in the Modules and I don't know what I'm doing wrong! Completely new to VBA. Highlighted portion: Range("F" & RowNum & ":G" & RowNum).SelectSub MoveCells(RowNum as Integer) Range("F" & RowNum & ":G" & RowNum).Select Selection.Cut Range("D" & RowNum).Select ActiveSheet.PasteEnd Sub 解决方案 Range("F" & RowNum & ":G" & RowNum).Select ^ ^ ^ ^ | | | | Chr(147) Chr(34)The 'quotation marks' around F are character 147. To denote a string value you have to use character 34, like the ones around :GThis usually happens when copy/pasting code from a website. Delete the quotation marks and re-write them manually to solve the issue. 这篇关于运行时错误'1004':对象'_全局'的方法'范围'失败;简单复制和粘贴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-22 09:38