Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Travel through no of sheets in a workbook.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Raj - 27 Sep 2007 13:07 GMT
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.
JW - 27 Sep 2007 13:11 GMT
Sub thshets()
   For i = 1 To 25
       Sheets(i).Cells(1, 1).Value = "Something"
   Next i
End Sub

> Hi all,
>
[quoted text clipped - 4 lines]
> data in to each sheets can any one provide me with an solution for
> this problem.
crferguson@gmail.com - 27 Sep 2007 13:17 GMT
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

> Hi all,
>
[quoted text clipped - 4 lines]
> data in to each sheets can any one provide me with an solution for
> this problem.
Raj - 27 Sep 2007 13:28 GMT
On Sep 27, 5:17 pm, "crfergu...@gmail.com" <crfergu...@gmail.com>
wrote:
> Well, without mroe information than that, here's a basic place to
> start:
[quoted text clipped - 27 lines]
>
> - Show quoted text -

thanks a lot for ur valuable solution
crferguson@gmail.com - 27 Sep 2007 13:46 GMT
On Sep 27, 7:17 am, "crfergu...@gmail.com" <crfergu...@gmail.com>
wrote:
> Well, without mroe information than that, here's a basic place to
> start:
[quoted text clipped - 27 lines]
>
> - Show quoted text -

I'm glad it helped.  Have a great week.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.