Change result of Macro Recorder

  • Thread starter Thread starter Jim May
  • Start date Start date
J

Jim May

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
 
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
 
Yes you might as well!

Cordially
Pascal

Jim May said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top