Hello,
I have been slowly learning VBA language and macros, and built my first user form yesterday. I was able to successfully get the form to open via a button, clear entry, close the form, and produce an error message when the form isn't completely filled out. However, the final and most important step involves add the information entered into the user form into the actual excel workbook, and that part is not using.
I have been using the following with statement, and for some reason it is posting the first entry into my desired field but then skipping a bunch of columns before posting the rest. Any suggestions?
RowCount = Worksheets("Current Projects").Range("D2").CurrentRegion.Rows.Count
With Worksheets("Current Projects").Range("D2")
.Offset(RowCount, 0).Value = Me.txtName.Value
.Offset(RowCount, 1).Value = Me.txtDes.Value
.Offset(RowCount, 2).Value = Me.txtType.Value
.Offset(RowCount, 3).Value = Me.txtReq.Value
.Offset(RowCount, 4).Value = Me.txtLOB.Value
.Offset(RowCount, 5).Value = Me.txtRDate.Value
.Offset(RowCount, 6).Value = Me.TxtIE.Value
.Offset(RowCount, 7).Value = Me.txtAgn.Value
.Offset(RowCount, 8).Value = Me.txtDDate.Value
End With
Thank you for your help!
Corcelle
I have been slowly learning VBA language and macros, and built my first user form yesterday. I was able to successfully get the form to open via a button, clear entry, close the form, and produce an error message when the form isn't completely filled out. However, the final and most important step involves add the information entered into the user form into the actual excel workbook, and that part is not using.
I have been using the following with statement, and for some reason it is posting the first entry into my desired field but then skipping a bunch of columns before posting the rest. Any suggestions?
RowCount = Worksheets("Current Projects").Range("D2").CurrentRegion.Rows.Count
With Worksheets("Current Projects").Range("D2")
.Offset(RowCount, 0).Value = Me.txtName.Value
.Offset(RowCount, 1).Value = Me.txtDes.Value
.Offset(RowCount, 2).Value = Me.txtType.Value
.Offset(RowCount, 3).Value = Me.txtReq.Value
.Offset(RowCount, 4).Value = Me.txtLOB.Value
.Offset(RowCount, 5).Value = Me.txtRDate.Value
.Offset(RowCount, 6).Value = Me.TxtIE.Value
.Offset(RowCount, 7).Value = Me.txtAgn.Value
.Offset(RowCount, 8).Value = Me.txtDDate.Value
End With
Thank you for your help!
Corcelle