IgnBan
08-08-2008, 10:34 AM
How can I modify this code to select a dynamic range;
I need to select the range that I'm coping, starting in the column A 5th row to colunm Y. The column that will always have data in the last row will be column C. I also want to copy the data with all the formulas formatting, etc exactly as is on the copied sheet.
Sub Paste_Data()
Range("J55:AR55").Select
Selection.Copy
Call OpenWB
ActiveWorkbook.Range("A").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Paste
ActiveWorkbook.Save
ActiveWorkbooks.Close
End Sub
Sub OpenWB()
Test = "C\Test.xls" 'Open File...........
Workbooks.Open Filename:=Test
End Sub
Thanks in advance for any input. :thumb
I need to select the range that I'm coping, starting in the column A 5th row to colunm Y. The column that will always have data in the last row will be column C. I also want to copy the data with all the formulas formatting, etc exactly as is on the copied sheet.
Sub Paste_Data()
Range("J55:AR55").Select
Selection.Copy
Call OpenWB
ActiveWorkbook.Range("A").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Paste
ActiveWorkbook.Save
ActiveWorkbooks.Close
End Sub
Sub OpenWB()
Test = "C\Test.xls" 'Open File...........
Workbooks.Open Filename:=Test
End Sub
Thanks in advance for any input. :thumb