Changing objects on other Worksheets with Variables

D

Dave Baranas

I am working on a spreadsheet that has 400+ sheets and I need to
change controls on many different sheets from many different sheets. 1
sheet needs to change things on whatever sheet has been selected from
a combobox

If ComboBox1 = "certainvalue" ' ComboBox with list of many sheets
Worksheets("certainworksheet").Activate ' Goes to that sheet
DoSomeThing ' Procedure that will change lots of values on selected
sheet
Set a Variable to This Sheet Name' I CAN'T FIGURE WHAT TYPE TO PUT
HERE!!!
End If

DoSomething()
If CheckBox1.Value = True Then
OtherSheet.ComboBox.Value = "Something" ' I CAN'T FIGURE OUT HOW TO
USE A VARIABLE "Othersheet" even though I can get a variable who's
value is right it gives errors

Any Help would be appreciated. I have combed through the usenet and
VBA sites looking for something as simple as using a variable name
like this and nothing.

Thanks in Advance

Dave Baranas
 
B

Bob Phillips

Dave,

If I understand the question, you need

Set oWS = Worksheets(Combobox1.Value)


oWS.Range("A1") = "value on selected worklsheet"
 
D

Dave Baranas

Thanks Bob!!!

It Works!


Bob Phillips said:
Dave,

If I understand the question, you need

Set oWS = Worksheets(Combobox1.Value)


oWS.Range("A1") = "value on selected worklsheet"

--

HTH

Bob Phillips
 

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