HappyLadyToo
Board Regular
- Joined
- Aug 28, 2012
- Messages
- 64
Hello All,
Below is a formula I found on the website and I've been trying to modify it and make it work for what I need but to no avail.
Here's what I'm trying to do: In column B is a list of last names, however, some of the cells are empty. For those cells that are empty but the row still has other info, I want to copy the row from spreadsheet 'npc main' to spreadsheet 'review'. Both are in the same workbook. Once the row has been copied, it should be deleted from 'npc main'. When I run the macro below, it runs through column B but nothing is copied and the macro won't end when it reaches an empty row. I've been working on it for two days and now I'm asking for help. Thank you for your time.![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Sub Workbook_Open()
Dim temp1 As String
Dim temp2 As String
Dim temp3 As String
Sheets("npc main").Select
Range("B1").Select
While ActiveCell.Value <> "*"
temp1 = ""
temp1 = Left(ActiveCell.Value, 2)
If temp1 = "" And Row <> "" Then
Rows(ActiveCell.Row).Copy
Sheets("review").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Select
Sheets("npc main").Select
Application.CutCopyMode = False
End If
ActiveCell.Offset(1, 0).Select
Wend
End Sub
Below is a formula I found on the website and I've been trying to modify it and make it work for what I need but to no avail.
Here's what I'm trying to do: In column B is a list of last names, however, some of the cells are empty. For those cells that are empty but the row still has other info, I want to copy the row from spreadsheet 'npc main' to spreadsheet 'review'. Both are in the same workbook. Once the row has been copied, it should be deleted from 'npc main'. When I run the macro below, it runs through column B but nothing is copied and the macro won't end when it reaches an empty row. I've been working on it for two days and now I'm asking for help. Thank you for your time.
Sub Workbook_Open()
Dim temp1 As String
Dim temp2 As String
Dim temp3 As String
Sheets("npc main").Select
Range("B1").Select
While ActiveCell.Value <> "*"
temp1 = ""
temp1 = Left(ActiveCell.Value, 2)
If temp1 = "" And Row <> "" Then
Rows(ActiveCell.Row).Copy
Sheets("review").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Select
Sheets("npc main").Select
Application.CutCopyMode = False
End If
ActiveCell.Offset(1, 0).Select
Wend
End Sub