ncjefffl
New Member
- Joined
- May 5, 2010
- Messages
- 22
I've got a macro that I recorded (because I don't know how to write one) that just copies certain columns from one tab into another. It's been working until today, where I get a" subscript out of range" error and it goes to the highlighted section of my code (below). I think the issue is that it's trying to copy data from blank cells. When I recorded it, I just highlighted the columns I wanted copied. I don't know how to tell it to only copy the cells with data, which is think is what I need to do to avoid this. Or it's something else entirely. Can anyone help me with this?
Here is the bit of code that it goes to when I get the error:
Here is the bit of code that it goes to when I get the error:
Code:
ActiveWindow.ScrollRow = 15
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 1
[SIZE=4][COLOR=#0000ff]Sheets("Page").Select
[/COLOR][/SIZE] ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 15
Columns("S:V").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1").Select
Range("B1").Select
ActiveSheet.Paste
Sheets("Page").Select