Hello,
I hope you are all well.
I am trying to work on the below code that allows me to enter data into the last column in a range of rows that has all blank cells (that is the columns starting from column 43 to the right).
In other words, it means entering data into the column after the last column that contains text or numbers.
This is currently my code:
Please let me know if you need clarification.
I hope you are all well.
I am trying to work on the below code that allows me to enter data into the last column in a range of rows that has all blank cells (that is the columns starting from column 43 to the right).
In other words, it means entering data into the column after the last column that contains text or numbers.
This is currently my code:
Rich (BB code):
Private Sub cmdAdd_Click()
Dim lastrow As Long, count As Long
lastrow = Sheets("Referenced Data (Do not change)").Cells(Rows.count, 41).End(xlUp).Row
lastrow = lastrow + 1
Sheets("Referenced Data (Do not change)").Cells(lastrow, 41) = cmdDrawingNo
count = 0
For i = 8 To lastrow
If cmdDrawingNo = Sheets("Referenced Data (Do not change)").Cells(i, 41) Then
count = count + 1
End If
If count > 1 Then
Sheets("sheet2").Cells(lastrow, 41) = ""
Sheets("sheet2").Cells(lastrow, 42) = ""
Sheets("sheet2").Cells(lastrow, 43) = ""
MsgBox "Duplicate entry! Name already exists!"
End If
If count = 1 Then
Sheets("sheet2").Cells(lastrow, 41) = Number.Text
Sheets("sheet2").Cells(lastrow, 42) = Name.Text
Sheets("sheet2").Cells(lastrow, 43) = MobileNo.Value
End If
Next
End Sub
Please let me know if you need clarification.
How to enter data into the last column in a range of rows that has all blanks [SOLVED]
Hi All, I hope you are all well. I am trying to work on the below code that allows me to enter data into the last column in a range of rows that has all blank cells (that is the columns starting from column 43 to the right). In other words, it means entering data into the column after the...
www.excelforum.com