Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing objects on other Worksheets with Variables
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing objects on other Worksheets with Variables
-- HTH Bob Phillips "Dave Baranas" wrote in message om... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing objects on other Worksheets with Variables
Dave,
If I understand the question, you need Set oWS = Worksheets(Combobox1.Value) oWS.Range("A1") = "value on selected worklsheet" -- HTH Bob Phillips "Dave Baranas" wrote in message om... 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing objects on other Worksheets with Variables
Thanks Bob!!!
It Works! "Bob Phillips" wrote in message ... Dave, If I understand the question, you need Set oWS = Worksheets(Combobox1.Value) oWS.Range("A1") = "value on selected worklsheet" -- HTH Bob Phillips "Dave Baranas" wrote in message om... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
finding the results of changing 4 variables | Excel Discussion (Misc queries) | |||
Copying functions without changing most variables in it | Excel Discussion (Misc queries) | |||
How can I rotate objects in draw without changing shape? | New Users to Excel | |||
renaming worksheets/objects in VBA | Excel Worksheet Functions | |||
When linked objects update in Word,it keeps changing the spacing? | Excel Discussion (Misc queries) |