View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
TimT TimT is offline
external usenet poster
 
Posts: 69
Default Selecting an active cell

Thanks for your help.
Is the second line of code correct? or should it be
frm_wc.tb_2.value = ActiveCell.Offset(0,1).Value

"Jim Thomlinson" wrote:

frm_W2.tb_EIN.Value = ActiveCell.Value
--
HTH...

Jim Thomlinson


"TimT" wrote:

Hello all,
I have a userform that is opened from a button on a worksheet.

Private Sub
range(A11).select
frm_W2.show
End Sub

The userform is opened after cell A11 is selected because when the userform
opens I want it to populate itself with the first record's data on the
worksheet.
The reason I don't select the cell in this sub is because I need to call
this code up later to repopulate another record.

frm_W2.tb_EIN.Value = ws.Cells(ActiveCell).Value
frm_wc.tb_2.value = ws.Cells.Offset(0,1).Value
and so on...

I get a type mismatch with the first line.

Can someone help with this?