dukeofscouts
Board Regular
- Joined
- Jan 19, 2009
- Messages
- 146
Hello,
Id like to use a macro to copy a range of cells and paste them in a new range. To do this I've been able to get a macro that reads as follows:
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 5/31/2009 by Dukeofscouts
'
'
Range("A2").Select
ActiveCell.Range("A1:A6").Select
Selection.Copy
ActiveCell.Offset(Range("d1"), Range("f1")).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveCell.Offset(-3, -3).Range("A1").Select
End Sub
Where I need help is getting the "activecell.Range(A1:A6").select to be looking at B1 to read the number of rows in the range. B1 is "=sumproduct(--((a2:a102)<>""))
All my attempts to get this to work have resulted in error messages. Is this possible to do?
Thanks,
D.O.S.
Id like to use a macro to copy a range of cells and paste them in a new range. To do this I've been able to get a macro that reads as follows:
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 5/31/2009 by Dukeofscouts
'
'
Range("A2").Select
ActiveCell.Range("A1:A6").Select
Selection.Copy
ActiveCell.Offset(Range("d1"), Range("f1")).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveCell.Offset(-3, -3).Range("A1").Select
End Sub
Where I need help is getting the "activecell.Range(A1:A6").select to be looking at B1 to read the number of rows in the range. B1 is "=sumproduct(--((a2:a102)<>""))
All my attempts to get this to work have resulted in error messages. Is this possible to do?
Thanks,
D.O.S.