View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Selecting a worksheet from a combobox

With Worksheets(cboWSPicker.Value)
.Range("A1").Value = txtC1.Text
.Range("B1").Value = txtC2.Text
End With

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"rowlo-efc" wrote in message
oups.com...
Hi,

I have created a user form that contains two text fields that fill data
starting from "C1" on a worksheet (text entries going in C1 & C2)

These entries (different values) need to be made across several
worksheets. So I am trying to place a combobox (cboWSPicker) on the
userform that allows me to select the worksheet that I want to work
with and then start data filling from cell C1
(there is a CmdOK button that activates this).

I can get the form to start data filling from C1 when the worksheet is
already 'active'

I can make a combobox activate a 'worksheet'.

but I cant make the cboWSPicker combobox activate a worksheet and then
data entry start from cell C1 when I click the cmdOK button...

e.g. In the cboWSPicker Drop down, I choose the value 'Sheet1'
in txtC1 i put in the value 10%
in txtC2 i put in the value 20%

I then click the ok button (CmdOK) and nothing happens (except a load
of error messages appear).

Can anyone help?

Thanks

Jamie