PDA

View Full Version : MyPosition Help with UserForm



jimbokentuck
09-06-2008, 02:38 PM
Hi,
Need some help with a Userform in VBA/Excel. Have written a series or macros that open the userform for input. What I'd like to happen is whenever the user triggers the macro to open the userform, I'd like the data to be input into the cell to the right of the users current position in the worksheet. However the code I'm using to input the data into the worksheet is continually placing the answer in the same cell and doesn't change. Somehow I'd like to write a code that will place the information into the worksheet, current position +1.

Thanks,
Jimbo

Dim ctl As Control
RowCount = Worksheets("Expense Report").Range("A1").CurrentRegion.Rows.Count
With Worksheets("Expense Report").Range("A10")
.Offset(RowCount, 30).Value = Me.GSTEXPENSE.Value
End With

Bob Phillips
09-07-2008, 06:07 AM
Dim ctl As Control
Dim RowCount As Long, ColCount As Long
With Worksheets("Expense Report")
RowCount = .Range("A1").CurrentRegion.Rows.Count
ColCount = .Cells(rowciunts, .Columns.Count).End(xlToLeft).Column
.Offset(RowCount, ColCount + 1).Value = Me.GSTEXPENSE.Value
End With