Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I found the following module during a a help search. I don't know "Maniac"
but the code works great. I am having a problem remembering to exclude any worksheets that I do not want to process. If anyone else adds a new worksheet to the workbook they don't know how to exclude it. As you can see I already have 7 worksheets excluded. I am thinking of adding two new worksheets (named A & Z). Between these two worksheets would be all worksheets that I do want processed. I need help with the new code that would process only worksheets between Worksheet A and Worksheet Z. Then I would only have to exclude the starting and ending worksheets. Does that make sense - and is it possible?. If Maniac is out there - thanks for your help! If you or anyone else could help writing new code, I would appreciate it. Hank Sub SignOutLog() ' ' MakeSummary Macro ' Macro created 6/12/2006 by Maniac ' ' Sheets("SignOutLog").Select ' Clear the existing values (if any) Range("$A$2:$m$60").Value = "" ' J tracks the row number on the summary page ' I tracks the sheet number being processed J = 2 For I = 2 To Sheets.Count a$ = Sheets(I).Name ' Don't process a sheet if its name Other than "SignOutLog" ' or if the name is blank. If (a$ = "Birthday") Then GoTo 10 If (a$ = "DepositRecord") Then GoTo 10 If (a$ = "MailLabels") Then GoTo 10 If (a$ = "PmtSummary") Then GoTo 10 If (a$ = "Templat") Then GoTo 10 If (a$ = "ID") Then GoTo 10 If (a$ = "SignOutLog") Then GoTo 10 If (Sheets(a$).Range("$C$1").Value = "") Then GoTo 10 ' Process the current sheet Range("c" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R6C3" Range("d" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R6C4" Range("e" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R6C14" Range("a" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R9C9" J = J + 1 10 Next I End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
maybe you can use something like this:
Sub SignOutLog() ' ' MakeSummary Macro ' Macro created 6/12/2006 by Maniac ' Dim shtarr As Variant ' Sheets("SignOutLog").Select ' Clear the existing values (if any) Range("$A$2:$m$60").Value = "" ' J tracks the row number on the summary page ' I tracks the sheet number being processed shtarr = Array("Sheet1", "Sheet2", "Sheet3") j = 2 For i = LBound(shtarr) To UBound(shtarr) a$ = Sheets(shtarr(i)).Name ' If (Sheets(shtarr(i)).Range("$C$1").Value = "") Then GoTo 10 ' Process the current sheet With Sheets(shtarr(i)) .Range("c" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R6C3" .Range("d" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R6C4" .Range("e" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R6C14" .Range("a" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R9C9" j = j + 1 End With 10 Next i End Sub -- Gary "HH" wrote in message ... I found the following module during a a help search. I don't know "Maniac" but the code works great. I am having a problem remembering to exclude any worksheets that I do not want to process. If anyone else adds a new worksheet to the workbook they don't know how to exclude it. As you can see I already have 7 worksheets excluded. I am thinking of adding two new worksheets (named A & Z). Between these two worksheets would be all worksheets that I do want processed. I need help with the new code that would process only worksheets between Worksheet A and Worksheet Z. Then I would only have to exclude the starting and ending worksheets. Does that make sense - and is it possible?. If Maniac is out there - thanks for your help! If you or anyone else could help writing new code, I would appreciate it. Hank Sub SignOutLog() ' ' MakeSummary Macro ' Macro created 6/12/2006 by Maniac ' ' Sheets("SignOutLog").Select ' Clear the existing values (if any) Range("$A$2:$m$60").Value = "" ' J tracks the row number on the summary page ' I tracks the sheet number being processed J = 2 For I = 2 To Sheets.Count a$ = Sheets(I).Name ' Don't process a sheet if its name Other than "SignOutLog" ' or if the name is blank. If (a$ = "Birthday") Then GoTo 10 If (a$ = "DepositRecord") Then GoTo 10 If (a$ = "MailLabels") Then GoTo 10 If (a$ = "PmtSummary") Then GoTo 10 If (a$ = "Templat") Then GoTo 10 If (a$ = "ID") Then GoTo 10 If (a$ = "SignOutLog") Then GoTo 10 If (Sheets(a$).Range("$C$1").Value = "") Then GoTo 10 ' Process the current sheet Range("c" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R6C3" Range("d" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R6C4" Range("e" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R6C14" Range("a" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R9C9" J = J + 1 10 Next I End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have inserted worksheets A & Z. Between them are all the worksheets to be
processed. When I run the code I get ERROR- "Runtime error '9': Subscript out of range highlighet in yellow is: A$ = Sheets(shtarr(i)).Name Did I do something wrong? "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... maybe you can use something like this: Sub SignOutLog() ' ' MakeSummary Macro ' Macro created 6/12/2006 by Maniac ' Dim shtarr As Variant ' Sheets("SignOutLog").Select ' Clear the existing values (if any) Range("$A$2:$m$60").Value = "" ' J tracks the row number on the summary page ' I tracks the sheet number being processed shtarr = Array("Sheet1", "Sheet2", "Sheet3") j = 2 For i = LBound(shtarr) To UBound(shtarr) a$ = Sheets(shtarr(i)).Name ' If (Sheets(shtarr(i)).Range("$C$1").Value = "") Then GoTo 10 ' Process the current sheet With Sheets(shtarr(i)) .Range("c" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R6C3" .Range("d" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R6C4" .Range("e" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R6C14" .Range("a" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R9C9" j = j + 1 End With 10 Next i End Sub -- Gary "HH" wrote in message ... I found the following module during a a help search. I don't know "Maniac" but the code works great. I am having a problem remembering to exclude any worksheets that I do not want to process. If anyone else adds a new worksheet to the workbook they don't know how to exclude it. As you can see I already have 7 worksheets excluded. I am thinking of adding two new worksheets (named A & Z). Between these two worksheets would be all worksheets that I do want processed. I need help with the new code that would process only worksheets between Worksheet A and Worksheet Z. Then I would only have to exclude the starting and ending worksheets. Does that make sense - and is it possible?. If Maniac is out there - thanks for your help! If you or anyone else could help writing new code, I would appreciate it. Hank Sub SignOutLog() ' ' MakeSummary Macro ' Macro created 6/12/2006 by Maniac ' ' Sheets("SignOutLog").Select ' Clear the existing values (if any) Range("$A$2:$m$60").Value = "" ' J tracks the row number on the summary page ' I tracks the sheet number being processed J = 2 For I = 2 To Sheets.Count a$ = Sheets(I).Name ' Don't process a sheet if its name Other than "SignOutLog" ' or if the name is blank. If (a$ = "Birthday") Then GoTo 10 If (a$ = "DepositRecord") Then GoTo 10 If (a$ = "MailLabels") Then GoTo 10 If (a$ = "PmtSummary") Then GoTo 10 If (a$ = "Templat") Then GoTo 10 If (a$ = "ID") Then GoTo 10 If (a$ = "SignOutLog") Then GoTo 10 If (Sheets(a$).Range("$C$1").Value = "") Then GoTo 10 ' Process the current sheet Range("c" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R6C3" Range("d" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R6C4" Range("e" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R6C14" Range("a" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R9C9" J = J + 1 10 Next I End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
replace these sheet names with the names of the sheets you want to run your
code on shtarr = Array("Sheet1", "Sheet2", "Sheet3") then try it -- Gary Excel 2003 "HH" wrote in message ... I have inserted worksheets A & Z. Between them are all the worksheets to be processed. When I run the code I get ERROR- "Runtime error '9': Subscript out of range highlighet in yellow is: A$ = Sheets(shtarr(i)).Name Did I do something wrong? "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... maybe you can use something like this: Sub SignOutLog() ' ' MakeSummary Macro ' Macro created 6/12/2006 by Maniac ' Dim shtarr As Variant ' Sheets("SignOutLog").Select ' Clear the existing values (if any) Range("$A$2:$m$60").Value = "" ' J tracks the row number on the summary page ' I tracks the sheet number being processed shtarr = Array("Sheet1", "Sheet2", "Sheet3") j = 2 For i = LBound(shtarr) To UBound(shtarr) a$ = Sheets(shtarr(i)).Name ' If (Sheets(shtarr(i)).Range("$C$1").Value = "") Then GoTo 10 ' Process the current sheet With Sheets(shtarr(i)) .Range("c" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R6C3" .Range("d" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R6C4" .Range("e" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R6C14" .Range("a" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R9C9" j = j + 1 End With 10 Next i End Sub -- Gary "HH" wrote in message ... I found the following module during a a help search. I don't know "Maniac" but the code works great. I am having a problem remembering to exclude any worksheets that I do not want to process. If anyone else adds a new worksheet to the workbook they don't know how to exclude it. As you can see I already have 7 worksheets excluded. I am thinking of adding two new worksheets (named A & Z). Between these two worksheets would be all worksheets that I do want processed. I need help with the new code that would process only worksheets between Worksheet A and Worksheet Z. Then I would only have to exclude the starting and ending worksheets. Does that make sense - and is it possible?. If Maniac is out there - thanks for your help! If you or anyone else could help writing new code, I would appreciate it. Hank Sub SignOutLog() ' ' MakeSummary Macro ' Macro created 6/12/2006 by Maniac ' ' Sheets("SignOutLog").Select ' Clear the existing values (if any) Range("$A$2:$m$60").Value = "" ' J tracks the row number on the summary page ' I tracks the sheet number being processed J = 2 For I = 2 To Sheets.Count a$ = Sheets(I).Name ' Don't process a sheet if its name Other than "SignOutLog" ' or if the name is blank. If (a$ = "Birthday") Then GoTo 10 If (a$ = "DepositRecord") Then GoTo 10 If (a$ = "MailLabels") Then GoTo 10 If (a$ = "PmtSummary") Then GoTo 10 If (a$ = "Templat") Then GoTo 10 If (a$ = "ID") Then GoTo 10 If (a$ = "SignOutLog") Then GoTo 10 If (Sheets(a$).Range("$C$1").Value = "") Then GoTo 10 ' Process the current sheet Range("c" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R6C3" Range("d" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R6C4" Range("e" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R6C14" Range("a" + Format(J)).FormulaR1C1 = "='" + a$ + "'!R9C9" J = J + 1 10 Next I End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Summary page | Excel Programming | |||
How to Populate a summary page from the input page??????????????????????? | Excel Programming | |||
Summary page | Excel Discussion (Misc queries) | |||
Summary Page | Excel Programming | |||
Summary on one page | Excel Programming |