|
-
May 5th, 2004, 11:36 AM
#1
Thread Starter
Member
vb for excel
I am using VB fo Excel. I want to activate a sheet of a workbook. The name of the workbook is entered as data ( thanks to your help) with no problem. Now I want to Activate a worksheet of the above workbook, also entered as data. I tried several alternatives to enter this sheet as data, but all failed. Any help?. Thank you. Norah
-
May 5th, 2004, 05:17 PM
#2
Addicted Member
MyString = "sheet1"
Worksheets(MyString).activate
-
May 6th, 2004, 12:58 AM
#3
Member
Hi Norah,
On the Excel sheet.
Press Alt + F11
Go to Insert | Module
Type This:
Sub Active()
MyString = "BOQ"
Worksheets(MyString).Activate
End Sub
Where BOQ is the sheet name that you want to Activate. You can replace it with any other name that you have.
Now Press Alt + F11 again to come back to excel and from the Tools | Macro run Active.
Plus you can assign this to a button as well to avoid going to Tools | Macro.
Best Regards,
S h a n
-
May 6th, 2004, 11:00 AM
#4
Am I missing something or isn't it simpler to just click the sheet
tab at the bottom of the workbook to activate that sheet instead
of creating a toolbar button to simulate the sheet tab click?
Or is this being used in automation?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 8th, 2004, 01:00 AM
#5
Member
well, people like automation these days.
Assume you have 70-80 sheets on a workbook. This might help there. isn't it ?
Best Regards,
S h a n
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|