LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Use a macro to create new sheets

Working with check boxes on a sheet is not my favorite thing.

so I use a selection-change macro to put an X in column A, or remove it

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
If Len(Target) = 0 Then
Target = "X"
Else
Target.ClearContents
End If
End Sub

Than my update code just loops through column A and responds if column A =
"X",
or if len(cel)0 or Ucase(cel)= "X" or .....

see if this helps....
keep me posted...
--
steveB

Remove "AYN" from email to respond
wrote in message
oups.com...
Thank you very much for the references. I had already been to a few of
them but most were new to me. Right now I have attempted to get
through the first part with some success but then made changes and
didn't save in time.

Just for clarification, here is what I am trying to do:

I have a list of check boxes on sheet one. Each checkbox is a product
and there are 15 checkbox items but that quantity will expand
periodically. The user will click a few or possibly all of the
checkboxes and then click an update button. The update button will
create a new sheet for each selected box. The new sheet will be a copy
of sheet2 which is a general template that they will fill out. The new
sheets will be named corresponding to the checkbox name and a cell in
the new sheets will also contain the corresponding checkbox name.

The items listed on sheet1 are Carmine, Earlibrite, Festival, Galante,
etc... If selected then these names will also be the names of the
sheets and the header or title on each of those sheets.

The code I currently have is the following:

Private Sub UpdateButton_Click()

Dim ctl As OLEObject

For Each ctl In Sheet2.OLEObjects
If TypeName(ctl.Object) = "CheckBox" Then
If ctl.Object.Value = True Then
Worksheets.Add After:=Worksheets("Sheet2")
Worksheets(Worksheets.Count - 1).Name = CheckBox.Name
CheckBox.Name = ""

End If
End If
Next ctl
End Sub

In the meantime I have ordered John Walkenbach's book on VBA
programming because his book Excel Formulas 2000 has been my bible.

Thank you Steve



 
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
Create a macro to create excel line graph with coloured pointers anddata lables anuj datta Charts and Charting in Excel 1 September 30th 09 04:04 PM
Macro to create new workbook and sheets Richard Excel Discussion (Misc queries) 1 July 31st 07 07:31 PM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Excel Worksheet Functions 4 August 17th 06 06:23 AM
Create New Workbook - Name book - 4 Sheets - Name Sheets Greg[_21_] Excel Programming 6 June 12th 05 04:41 AM
have Macro automatically delete and create sheets web_surfer[_2_] Excel Programming 0 February 27th 04 04:03 AM


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