Hi
I am having some problems with either my code or workbook formatting.
Problem is that This code works well in my other sheet in the same workbook but not on the other sheets it doesn't capturing the data from userform in the next empty row instead it's putting the data into the row 48??? I have checked it and all rows from 1 to 47 are empty but for some reason it doesn't see it or thinks these rows containing some data. This is very strange, I have selected all rows and click delete but it didn't hep at all.
Any suggestions please?
Thank You
Private Sub cmdSubmit_Click()
Dim rw As Long 'next available row
With ActiveSheet
'get the next avialable row in ActiveSheet
rw = .Range("A" & .Rows.Count).End(xlUp).Row + 1
'put the text box values in this row
.Range("A" & rw).Value = txtName.Value
.Range("B" & rw).Value = txtShift.Value
'copy the formula from the previous row
.Range("C" & rw - 1 & ":G" & rw - 1).Copy
.Range("C" & rw & ":G" & rw).PasteSpecial Paste:=xlPasteFormulas
Application.CutCopyMode = False
End With
'================================
'OPTIONAL - clear the text boxes
'================================
'txtName.Value = ""
'txtAge.Value = ""
'==========================
'OPTIONAL - unload the form
'==========================
'unload me
End Sub
Bookmarks