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: 33
Default Quick question about dynamically adding and naming worksheets

The following snippet of code works, but I'd like to simplify it. In the formula, I'd like to change the sheet name to ctl.Caption, but no clue on the syntax of it. I've tried a million different things, so I'm starting to wonder if it's even possible. Thanks for any help you can give.(again)

For each ctl in grpClasses.Controls
If ctl.Value = True Then
Unload Me
'On Error GoTo e:
Set wsTest = Worksheets.Add
wsTest.Name = "Report" & ctl.caption
With Worksheets(ctl.Caption)
Range("a4").Select
ActiveCell.FormulaR1C1 = _
"=IF(INDIRECT(""1a!A""&ROW()+11)=0,"" "",INDIRECT""1a!""&ROW ()+11))"
Selection.AutoFill Destination:=Range("A4:A28"), Type:=xlFillDefault
End With

Robbyn
 
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
a quick way of inserting and naming multiple worksheets in Excel? Sue[_4_] Excel Worksheet Functions 5 December 4th 09 10:36 PM
Dynamically Naming a Table of Data Ivor Davies Excel Discussion (Misc queries) 2 August 28th 09 07:02 AM
Quick question on naming a union of ranges [email protected] Excel Discussion (Misc queries) 2 July 29th 07 11:15 AM
Adding and Naming Multiple Worksheets Byron Excel Worksheet Functions 6 September 8th 05 02:52 AM
Emergency ( Adding Worksheets dynamically in Workbookds) Ussiddiqui[_3_] Excel Programming 3 January 27th 04 06:45 PM


All times are GMT +1. The time now is 02:32 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"