mysterious-dr-x
Board Regular
- Joined
- Jul 29, 2011
- Messages
- 51
So I have a code that is supposed to do the following;
'
' Template: find last line, select range & copy
' Global: open, find 1st blank line, paste, save & close
' Template: select A1
'
Now, everything seems to work fine, except that I need to find the last row of data twice, once in template, & once in global. The 2nd one is the one I have the problem with.
Having defined LR with the following* previously provided to me by JS411 (Thank you.)
My question is; Do I just use the same code to redefine it in the next section, or do I need to use something other than LR & if so, what, how etc?
*Rest of code upon request, but I suspect that you wont be needing it.
'
' Template: find last line, select range & copy
' Global: open, find 1st blank line, paste, save & close
' Template: select A1
'
Now, everything seems to work fine, except that I need to find the last row of data twice, once in template, & once in global. The 2nd one is the one I have the problem with.
Having defined LR with the following* previously provided to me by JS411 (Thank you.)
Code:
With ws
LR = .Cells.Find(What:="*", After:=.Range("A1"), _
LookIn:=xlFormulas, SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, MatchCase:=False).Row
...
...
...
End With
*Rest of code upon request, but I suspect that you wont be needing it.