Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default Create new sheets from data in either of two columns

3a. Select View Code.

"Bob Kilmer" wrote in message
...
Hmmm...
I am able to:
1. Copy the code from Option Explicit to End Function (inclusive)
2. Open a new workbook.
3. Right click on any sheet tab (Sheet1, for instance).
4. Select all (press Ctrl+A) (The only text you'll see is "Option
Explicit.")
5. Right-click ON the selection.
6. Choose Paste.
This should paste the code into the module.

I am using Excel 2002 on Windows 2K Pro.
Try the above steps as stated and let me know how it turns out. I am not
familiar with a macro dialog poping up as you describe.

Bob

<Campbell wrote in message
...
On Sat, 14 Aug 2004 23:36:02 -0400, "Bob Kilmer"
wrote:

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim wksThisSheet As Worksheet
Set wksThisSheet = ActiveSheet
Application.ScreenUpdating = False
If Not Intersect(Target, Range("C3:C382")) Is Nothing Then
If Not WorksheetExists(Range("C2").Text) Then _
Worksheets.Add(, Worksheets(Sheets.Count)).Name = _
Range("C2").Text
Intersect(Rows(Target.Row), Range("A:U")).Copy
Worksheets(Range("C2").Text).Rows(Target.Row)
ElseIf Not Intersect(Target, Range("F3:F382")) Is Nothing Then
If Not WorksheetExists(Range("F2").Text) Then _
Worksheets.Add(, Worksheets(Sheets.Count)).Name = _
Range("F2").Text
Intersect(Rows(Target.Row), Columns("A:U")).Copy
Worksheets(Range("F2").Text).Rows(Target.Row)
End If
wksThisSheet.Activate
Application.ScreenUpdating = True
End Sub

Private Function WorksheetExists(SheetName As String) As Boolean
Dim wks As Worksheet
WorksheetExists = False
For Each wks In Worksheets
If LCase(wks.Name) = LCase(SheetName) Then
WorksheetExists = True
Exit Function
End If
Next wks
End Function

Bob thanks for your macros ,but I am having a problem with where as
when I right click on the tab paste the macro I get a Macro dialogue
box asking a for a name to be entered.
When I try F8 to step through the code it will not permit me to do so.

Any ideas?





Reply
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
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 AND SHEETS BASED ON COLUMN DATA control freak Excel Worksheet Functions 2 July 20th 06 06:00 PM
Create a list of data from same cell but different sheets Eddie P Excel Discussion (Misc queries) 2 May 19th 06 08:01 PM
How do I create a summary worksheet that references data in other sheets? GB Excel Worksheet Functions 2 February 20th 06 08:50 PM
create a data-series based on two different columns of data ? Derrick Charts and Charting in Excel 1 June 20th 05 01:51 PM


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