Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get sheet from sheet name
Hi everyone
I am using Sheet3.Cells(1, 1) to get some value from Sheet3 but Sheet3 can change if i insert new sheets . So is there any function that retruns worksheet if i provides the sheet name. so instead of using varaible = Sheet3.Cells(attRow, attCol) i can use Dim sheet , varaible sheet = unknowFunciton("data sheet") ' "data sheet" is the name of Sheet3 varaible = sheet.Cells(1, 1) Regards Amaninder Saini :) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get sheet from sheet name
sheets("sheetname")
-- Don Guillett SalesAid Software wrote in message ps.com... Hi everyone I am using Sheet3.Cells(1, 1) to get some value from Sheet3 but Sheet3 can change if i insert new sheets . So is there any function that retruns worksheet if i provides the sheet name. so instead of using varaible = Sheet3.Cells(attRow, attCol) i can use Dim sheet , varaible sheet = unknowFunciton("data sheet") ' "data sheet" is the name of Sheet3 varaible = sheet.Cells(1, 1) Regards Amaninder Saini :) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get sheet from sheet name
Generally people use the codename because it does not change.
" wrote: Hi everyone I am using Sheet3.Cells(1, 1) to get some value from Sheet3 but Sheet3 can change if i insert new sheets . So is there any function that retruns worksheet if i provides the sheet name. so instead of using varaible = Sheet3.Cells(attRow, attCol) i can use Dim sheet , varaible sheet = unknowFunciton("data sheet") ' "data sheet" is the name of Sheet3 varaible = sheet.Cells(1, 1) Regards Amaninder Saini :) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get sheet from sheet name
If you use Sheet3.Cells(1, 1) that means that you are using the codename
(the VBA name if you like), not the Excel name. As such it will not change just by inserting new sheets, only if you change it in the VBIDE or by code. You could always set a sheet variable Dim sh As Worksheet Set sh = Worksheets("Sheet3") and then refer to sh later on. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) wrote in message ps.com... Hi everyone I am using Sheet3.Cells(1, 1) to get some value from Sheet3 but Sheet3 can change if i insert new sheets . So is there any function that retruns worksheet if i provides the sheet name. so instead of using varaible = Sheet3.Cells(attRow, attCol) i can use Dim sheet , varaible sheet = unknowFunciton("data sheet") ' "data sheet" is the name of Sheet3 varaible = sheet.Cells(1, 1) Regards Amaninder Saini :) |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get sheet from sheet name
hi man, Is this your mean. SUB GETNAME() FOR EACH SH IN ACTIVEWORKBOOK.WORKSHEETS SH.NAME = SH.RANGE(\"A1\").VALUE NEXT SH END SUB -- vumian ------------------------------------------------------------------------ vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494 View this thread: http://www.excelforum.com/showthread...hreadid=567427 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel sheet bootom half sheet goes behind top part of sheet | Excel Worksheet Functions | |||
Duplicate sheet, autonumber sheet, record data on another sheet | Excel Worksheet Functions | |||
How do I select price from sheet.b where sheet.a part no = sheet.b | Excel Worksheet Functions | |||
Copying cells from on sheet to another sheet (via sheet module) | Excel Programming | |||
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B | Excel Programming |