Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Travel through no of sheets in a workbook.
Hi all,
I'm facing with a problem can any one help me on the issue that i'm facing which is explained further.I'm working on an Hr report which has 30 sheets in in and in a loop i would like to travel up till the 25th sheet and while i'm travelling i would like to write some data in to each sheets can any one provide me with an solution for this problem. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Travel through no of sheets in a workbook.
Sub thshets()
For i = 1 To 25 Sheets(i).Cells(1, 1).Value = "Something" Next i End Sub Raj wrote: Hi all, I'm facing with a problem can any one help me on the issue that i'm facing which is explained further.I'm working on an Hr report which has 30 sheets in in and in a loop i would like to travel up till the 25th sheet and while i'm travelling i would like to write some data in to each sheets can any one provide me with an solution for this problem. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Travel through no of sheets in a workbook.
Well, without mroe information than that, here's a basic place to
start: Private Sub DoSomething() Dim w As Worksheet For Each w In ActiveWorkbook.Sheets 'this next line stops the code from 'running after sheet 25 If w.Index 25 Then Exit Sub 'code here to write something to 'a sheet as you're passing through. 'for example: Range("A1").Value = w.Name Next End Sub Hope that helps! Cory On Sep 27, 7:07 am, Raj wrote: Hi all, I'm facing with a problem can any one help me on the issue that i'm facing which is explained further.I'm working on an Hr report which has 30 sheets in in and in a loop i would like to travel up till the 25th sheet and while i'm travelling i would like to write some data in to each sheets can any one provide me with an solution for this problem. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Travel through no of sheets in a workbook.
On Sep 27, 5:17 pm, "
wrote: Well, without mroe information than that, here's a basic place to start: Private Sub DoSomething() Dim w As Worksheet For Each w In ActiveWorkbook.Sheets 'this next line stops the code from 'running after sheet 25 If w.Index 25 Then Exit Sub 'code here to write something to 'a sheet as you're passing through. 'for example: Range("A1").Value = w.Name Next End Sub Hope that helps! Cory On Sep 27, 7:07 am, Raj wrote: Hi all, I'm facing with a problem can any one help me on the issue that i'm facing which is explained further.I'm working on an Hr report which has 30 sheets in in and in a loop i would like to travel up till the 25th sheet and while i'm travelling i would like to write some data in to each sheets can any one provide me with an solution for this problem.- Hide quoted text - - Show quoted text - thanks a lot for ur valuable solution |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Travel through no of sheets in a workbook.
On Sep 27, 7:17 am, "
wrote: Well, without mroe information than that, here's a basic place to start: Private Sub DoSomething() Dim w As Worksheet For Each w In ActiveWorkbook.Sheets 'this next line stops the code from 'running after sheet 25 If w.Index 25 Then Exit Sub 'code here to write something to 'a sheet as you're passing through. 'for example: Range("A1").Value = w.Name Next End Sub Hope that helps! Cory On Sep 27, 7:07 am, Raj wrote: Hi all, I'm facing with a problem can any one help me on the issue that i'm facing which is explained further.I'm working on an Hr report which has 30 sheets in in and in a loop i would like to travel up till the 25th sheet and while i'm travelling i would like to write some data in to each sheets can any one provide me with an solution for this problem.- Hide quoted text - - Show quoted text - I'm glad it helped. Have a great week. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Print sheets by "All Sheets in workbook, EXCEPT for specific named sheets". Possible? | Excel Programming | |||
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA | Excel Worksheet Functions | |||
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? | Excel Worksheet Functions | |||
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? | Excel Programming | |||
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? | Excel Programming |