Entering Userform data to worksheet

P

porky2j

Hi Guys,

I have a user form that I am hoping will simplify data entry onto a
large wooksheet.

The user form logs growth measurements. Individual measurements will
always be entered onto the worksheet in the same row (i.e. weight =
r12, height = r22, sitting height = r23). There are various
calculations inbetween data points in the column so data is not always
logged in consecutive rows.

However, the column that they need to go into depends on the number of
times they have been seen. For example if it was their first
assessment the worksheet column the data needs to go into would be N,
2nd visit O, 3rd visit P and so on.

So I have a textbox in the Userform to log visit number. This data
does not need to be entered on the worksheet, but I was hoping that it
could be used to define the column offset somehow.

Can anyone help me out with wiring some code for a userform to get
round this? I am really struggling!

Many thanks in advance
 
J

Joel

To write to cells you can either use Range("A1") or cells(RowNumber,
ColumnNumber). You probably need cells(23, VisitNumber + 2). You may or may
not need the PLUS value.

Or you could do this to find last column in row 1 (or any row)

LastCol = Cells(1,columns.Count).end(xltoleft).Column
Cells(23,LastCol) = Data
 
P

porky2j

Perfect! the cells() function works a dream!!

Thanks so much for your guidance Joel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top