![]() |
Change result of Macro Recorder
Below produced by Macro Recorder:
Sub Macro1() ' ' Macro1 Macro ' Macro recorded 5/21/2005 by James May ' Selection.Copy Range("H17").Select Selection.PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False End Sub I need to replace the Line Range("H17").Select with a clickable designated other cell, not just H17 as was done with the recorder. What do I put in its place? TIA, |
Hello Jim
Use Application.InputBox eg: Selection.Copy Dim TheRange As Range Set TheRange = Application.InputBox("Select your range", "Range?", , , , , , 8) TheRangePaste.Special Paste:=xlPasteComments, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False HTH Cordially Pascal "Jim May" a écrit dans le message de news: R0Fje.13792$Fv.8489@lakeread01... Below produced by Macro Recorder: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 5/21/2005 by James May ' Selection.Copy Range("H17").Select Selection.PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False End Sub I need to replace the Line Range("H17").Select with a clickable designated other cell, not just H17 as was done with the recorder. What do I put in its place? TIA, |
Pascal:
Thanks for the code; since posting I discovered that perhaps I could also just eliminate my original first 2 lines of code: Selection.Copy Range("H17").Select and run (new) code after first (at the sheet) Copy, then click on my destination cell. Would this be an (OK) alternative? Tks again.. Jim "papou" wrote in message ... Hello Jim Use Application.InputBox eg: Selection.Copy Dim TheRange As Range Set TheRange = Application.InputBox("Select your range", "Range?", , , , , , 8) TheRangePaste.Special Paste:=xlPasteComments, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False HTH Cordially Pascal "Jim May" a écrit dans le message de news: R0Fje.13792$Fv.8489@lakeread01... Below produced by Macro Recorder: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 5/21/2005 by James May ' Selection.Copy Range("H17").Select Selection.PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False End Sub I need to replace the Line Range("H17").Select with a clickable designated other cell, not just H17 as was done with the recorder. What do I put in its place? TIA, |
Yes you might as well!
Cordially Pascal "Jim May" a écrit dans le message de news: jaGje.13814$Fv.5313@lakeread01... Pascal: Thanks for the code; since posting I discovered that perhaps I could also just eliminate my original first 2 lines of code: Selection.Copy Range("H17").Select and run (new) code after first (at the sheet) Copy, then click on my destination cell. Would this be an (OK) alternative? Tks again.. Jim "papou" wrote in message ... Hello Jim Use Application.InputBox eg: Selection.Copy Dim TheRange As Range Set TheRange = Application.InputBox("Select your range", "Range?", , , , , , 8) TheRangePaste.Special Paste:=xlPasteComments, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False HTH Cordially Pascal "Jim May" a écrit dans le message de news: R0Fje.13792$Fv.8489@lakeread01... Below produced by Macro Recorder: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 5/21/2005 by James May ' Selection.Copy Range("H17").Select Selection.PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False End Sub I need to replace the Line Range("H17").Select with a clickable designated other cell, not just H17 as was done with the recorder. What do I put in its place? TIA, |
All times are GMT +1. The time now is 10:07 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com