Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default 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
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
Print sheets by "All Sheets in workbook, EXCEPT for specific named sheets". Possible? Corey Excel Programming 2 December 11th 06 01:35 AM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Excel Worksheet Functions 4 August 17th 06 06:23 AM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Programming 6 March 29th 06 12:43 PM
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? StargateFanFromWork[_3_] Excel Programming 6 January 26th 06 06:31 PM


All times are GMT +1. The time now is 11:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"