RuthandAndy
New Member
- Joined
- Jul 18, 2011
- Messages
- 27
I can't get the following code to work for Find. The LastRow remains empty and x1ByRows and x1Previous also show empty?
'Activate the Production Plan workbook, find the empty row and paste data
ppwb.Activate
Sheets("Production Status").Select
'Find the last row
Dim LastRow
Dim DataRow
Dim ws As Worksheet
Set ws = ActiveSheet
LastRow = ws.Cells.Find(What:="*", _
SearchOrder:=x1ByRows, _
SearchDirection:=x1Previous).Row
DataRow = LastRow + 1
Rows("0:0").Offset(DataRow, 0).Select
'Store the data
Selection.Paste
'Activate the Production Plan workbook, find the empty row and paste data
ppwb.Activate
Sheets("Production Status").Select
'Find the last row
Dim LastRow
Dim DataRow
Dim ws As Worksheet
Set ws = ActiveSheet
LastRow = ws.Cells.Find(What:="*", _
SearchOrder:=x1ByRows, _
SearchDirection:=x1Previous).Row
DataRow = LastRow + 1
Rows("0:0").Offset(DataRow, 0).Select
'Store the data
Selection.Paste