ashgull80
09-03-2012, 11:03 AM
hi
i have this code which finds the first empty row then adds the data to the sheet. what im after then is to change the colour of the row from columns B-L
Private Sub cmdNewRoom_Click()
Sheets("materials2").Select
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("materials2")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 4) _
.End(xlUp).Offset(1, 0).Row
ws.Cells(iRow, 2).Value = Me.txtRoomName.Value
.Interior.Color = RGB(83, 142, 213)
End Sub
i have this code which finds the first empty row then adds the data to the sheet. what im after then is to change the colour of the row from columns B-L
Private Sub cmdNewRoom_Click()
Sheets("materials2").Select
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("materials2")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 4) _
.End(xlUp).Offset(1, 0).Row
ws.Cells(iRow, 2).Value = Me.txtRoomName.Value
.Interior.Color = RGB(83, 142, 213)
End Sub