Hi,
I have created quite a long macro so I won't bore you with the details. I have just been testing it and found that due to a data discrepancy, about half way through the process cannot continue.
The sheet is the screenshot below. The stage it's getting stuck at is one where the macro goes down column E removing everything in each cell except the number in square brackets. It uses the following code:
As you can see, when it gets to the cell containing "999 Ac" it errors. This is not a normal scenario and I don't know why our system exports the line like that. It's also a duplicate entry from the table (the one directly above it) so is completely unnecessary.
I guess the solution would be to create a macro which says:
"If any of the rows in column E don't begin with "Room #9999" then delete them."
How would I implement this?
I have created quite a long macro so I won't bore you with the details. I have just been testing it and found that due to a data discrepancy, about half way through the process cannot continue.
The sheet is the screenshot below. The stage it's getting stuck at is one where the macro goes down column E removing everything in each cell except the number in square brackets. It uses the following code:
Sub GetNums()
Dim LR As Long, i As Long
LR = Range("E" & Rows.Count).End(xlUp).Row
For i = 1 To LR
With Range("E" & i)
.Value = Val(Mid(.Value, InStr(.Value, "[") + 1, InStr(.Value, "]") - InStr(.Value, "[") - 1))
End With
Next i
End Sub
As you can see, when it gets to the cell containing "999 Ac" it errors. This is not a normal scenario and I don't know why our system exports the line like that. It's also a duplicate entry from the table (the one directly above it) so is completely unnecessary.
I guess the solution would be to create a macro which says:
"If any of the rows in column E don't begin with "Room #9999" then delete them."
How would I implement this?