Excel VBA pastespecial不工作

您好我正在尝试在Excel中转​​置链接,我正在为此写一个macros。 我唯一的问题是pastespecial选项不起作用。

Sub Transpose_Links() ' ' Transpose_Links Macro ' ' Hotkey: Ctrl+m ' 

我在这个时候想要在剪贴板上转置单元格,然后将它们粘贴到当前位置。 然后他们可以改变,所以链接保留在细胞的内容

 Sheets("wincc").Select ActiveSheet.Paste Link:=True Selection.Replace What:="=", Replacement:="xxx", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Application.CutCopyMode = True Selection.Cut 

再次切割改变的信息后,我想问一个范围在哪里粘贴他们成功,因为我已经尝试改变范围的值,它的工作。 我也试过使用普通粘贴,但这也没有工作。 我试图寻找类似的问题,但我没有find一个。 我也检查了msdn.microsoft.com上的方法,但我没有提供太多的信息。

 Dim rRange As Range Set rRange = Application.InputBox(Prompt:= _ "Please select a range with your Mouse to be bolded.", _ Title:="SPECIFY RANGE", Type:=8) rRange.PasteSpecial Paste = xlPasteAll, Operation = xlNone, SkipBlanks = _ False, Transpose:=True rRange.Replace What:="xxx", Replacement:="=", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub 

尝试这个:

 Sub Transpose_Links() Dim rRange As Range ' Transpose_Links Macro ' ' Hotkey: Ctrl+m ' Sheets("wincc").Select ActiveSheet.Paste Link:=True Selection.Replace What:="=", Replacement:="xxx", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Application.CutCopyMode = True Selection.Cut Set rRange = Application.InputBox(Prompt:= _ "Please select a range with your Mouse to be bolded.", _ Title:="SPECIFY RANGE", Type:=8) Selection.Copy rRange.PasteSpecial Paste:=xlPasteAll, Operation:=xlPasteSpecialOperationNone, SkipBlanks:=False, Transpose:=True rRange.Replace What:="xxx", Replacement:="=", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub