Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
finding the results of changing 4 variables irrhelp Excel Discussion (Misc queries) 4 June 19th 12 10:11 PM
Copying functions without changing most variables in it Ruleroftheblind Excel Discussion (Misc queries) 3 March 12th 09 04:54 AM
How can I rotate objects in draw without changing shape? oldgunnersmate New Users to Excel 1 October 17th 08 07:21 PM
renaming worksheets/objects in VBA scottydel Excel Worksheet Functions 2 July 22nd 07 09:36 PM
When linked objects update in Word,it keeps changing the spacing? Johnylikes Excel Discussion (Misc queries) 1 February 2nd 06 07:22 PM


All times are GMT +1. The time now is 09:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"