LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Using a variable to gain access to worksheets through codenames.

Ok, I'm trying to figure out this issue. I have a combo box with
several values that a user has to choose from. These values for example
go from A - C. I have named three sheets Sheet1, Sheet2, and Sheet3.
They're codenames are A, B, and C respectively. How can I get access to
these sheets using the entry from the combo box?

ElseIf ComboBox.Value < "" Then
Dim RowUse As Long
Dim wsh As Worksheet
Set wsh = ComboBox.Value
RowUse = wsh.Range("A65536").End(xlUp).Offset(1, 0).Row
wsh.Cells(RowUse, "A").Value = NameBox.Text
wsh.Cells(RowUse, "B").Value = IDBox.Text

this doesnt work.. does anyone have any other ideas? So let me just
confirm .. using Sheets() and Worksheets(), what goes in the
parenthesis is the actual Name from the name property not the name from
(name) [the code name] correct?. I know u would be able to do
A.cells(RowUse,"A")... etc. but if i have 20 different sheets i dont
have to have an elseif for each sheet...

 
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
I need open or gain access to an external file P.Grieshop Excel Discussion (Misc queries) 3 March 17th 10 08:12 PM
using variables in codenames [email protected] Excel Programming 1 April 28th 06 11:30 PM
Gain access to Email JohnUK Excel Programming 2 September 28th 05 12:49 PM
Spreadsheet to do annual investment gain$, % gain, for list notaspreadsheetgenius Excel Worksheet Functions 0 January 9th 05 07:51 AM
Using worksheet codenames dan Excel Programming 0 January 22nd 04 09:46 PM


All times are GMT +1. The time now is 08:36 AM.

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

About Us

"It's about Microsoft Excel"