Hey guys so I am having a issue getting my VBA to recognize my if elseif statement in macro. I want it to read the value of a cell and if the cell is not blank then copy the entire row say A45 to S45 and then copy it, go to a different sheet, insert a new row after the last row of data, and then paste the information into the new row. However if the cell is blank I want it to just do nothing!!
So far it just seems like my macro ignores part of my if elseif statement and will only do one or the other but it cant tell when the cell is empty or not!
This is the code I currently have that isnt working.
Sheets("SOURCE DATA").Select
If IsEmpty(C45) = False Then
Sheets("Boise Historical Data").Select
Sheets("SOURCE DATA").Select
Range("C45:S45").Copy
Sheets("Boise Historical Data").Activate
Range("A1").End(xlDown).Select
r = Selection.Row
Cells(r + 1, 1).EntireRow.Insert
Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Else
End If
Sheets("Boise Historical Data").Activate
End Sub
And this wont do what I want it to. It will work if there is some string of characters in C45 but when I make the cell blank it will still copy the row but with C45 still being empty and its not supposed to!
Any help would be great!
So far it just seems like my macro ignores part of my if elseif statement and will only do one or the other but it cant tell when the cell is empty or not!
This is the code I currently have that isnt working.
Sheets("SOURCE DATA").Select
If IsEmpty(C45) = False Then
Sheets("Boise Historical Data").Select
Sheets("SOURCE DATA").Select
Range("C45:S45").Copy
Sheets("Boise Historical Data").Activate
Range("A1").End(xlDown).Select
r = Selection.Row
Cells(r + 1, 1).EntireRow.Insert
Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Else
End If
Sheets("Boise Historical Data").Activate
End Sub
And this wont do what I want it to. It will work if there is some string of characters in C45 but when I make the cell blank it will still copy the row but with C45 still being empty and its not supposed to!
Any help would be great!