Consulting

Results 1 to 2 of 2

Thread: MyPosition Help with UserForm

  1. #1

    MyPosition Help with UserForm

    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

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    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
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •