I don't understand why this doesnt' work
I'm trying to copy data from one sheet to another but its' crazy
So I have
I can't get this thing to move the selection down one cell. Do I have to do the super tedious
Or some other such nonsense in order to get back to my pointer and increment down one cell?
I'm trying to copy data from one sheet to another but its' crazy
So I have
Code:
file = "l:\somefile.xls"
Dim book As Workbook
Dim pointer As Range
Dim sheet As Worksheet
Set pointer = Selection <=save where I am
On Error Resume Next
Application.DisplayAlerts = False
If Right(file, 3) = "xls" Or Right(file, 4) = "xlsx" Then
Workbooks.Open (file)
fn = Dir(file)
Set book = Workbooks(fn)
For Each sheet In book.Worksheets
pointer.Value = file
Set pointer = pointer.offset(1,0) <= this doesn't increment
Next
book.Close
End If
Application.DisplayAlerts = True
End Sub
I can't get this thing to move the selection down one cell. Do I have to do the super tedious
Code:
set currentbook = activeworkbook
.. bunch of code
currentbook.select
currentsheet.select
set pointer = pointer.offset(1,0)