Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default sheets(count) code

Hello.

I have several sheets, named A, B, C, D, ...., 1,2,3,.....and so on in a
workbook.

I want to do job WWW in each sheet named 1,2,3,...(not A,B,C,...)
when I tried with
For kkk = 1 to 15
sheets(kkk).select
WWW
next kkk
it changes from sheet A. I understand sheets(kkk) means kkk-th sheet in a
workbook.

How do I specify a sheet named variable kkk ?
Say, I want to select sheets("1") at first, then sheets("2"), and so on...

thanks.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default sheets(count) code

Hi

How about

Sub test()
Dim Ws As Worksheet
For Each Ws In ActiveWorkbook.Worksheets
If IsNumeric(Ws.Name) Then
Ws.Select
MsgBox Ws.Name
End If
Next
End Sub

--
HTH. Best wishes Harald
Followup to newsgroup only please

"Young-Hwan Choi" skrev i melding
...
Hello.

I have several sheets, named A, B, C, D, ...., 1,2,3,.....and so on in a
workbook.

I want to do job WWW in each sheet named 1,2,3,...(not A,B,C,...)
when I tried with
For kkk = 1 to 15
sheets(kkk).select
WWW
next kkk
it changes from sheet A. I understand sheets(kkk) means kkk-th sheet in a
workbook.

How do I specify a sheet named variable kkk ?
Say, I want to select sheets("1") at first, then sheets("2"), and so on...

thanks.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default sheets(count) code

Choi,
try this
Sub addData()
For i = 1 To Worksheets.Count
Worksheets(i).Activate
If IsNumeric(ActiveSheet.Name) Then
Range("A1") = ActiveSheet.Name
End If
Next
End Sub

Cecil

"Young-Hwan Choi" wrote in message
...
Hello.

I have several sheets, named A, B, C, D, ...., 1,2,3,.....and so on in a
workbook.

I want to do job WWW in each sheet named 1,2,3,...(not A,B,C,...)
when I tried with
For kkk = 1 to 15
sheets(kkk).select
WWW
next kkk
it changes from sheet A. I understand sheets(kkk) means kkk-th sheet in a
workbook.

How do I specify a sheet named variable kkk ?
Say, I want to select sheets("1") at first, then sheets("2"), and so on...

thanks.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default sheets(count) code

Hi
Try sheets(""&kkk).activate

The & character forces kkk to be text. There is probably some VBA
function that converts numbers to text too.

regards
Paul
"Young-Hwan Choi" wrote in message ...
Hello.

I have several sheets, named A, B, C, D, ...., 1,2,3,.....and so on in a
workbook.

I want to do job WWW in each sheet named 1,2,3,...(not A,B,C,...)
when I tried with
For kkk = 1 to 15
sheets(kkk).select
WWW
next kkk
it changes from sheet A. I understand sheets(kkk) means kkk-th sheet in a
workbook.

How do I specify a sheet named variable kkk ?
Say, I want to select sheets("1") at first, then sheets("2"), and so on...

thanks.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default sheets(count) code

Paul

This is exactly what I want, simple and works great.
Appreciate your help

regards,
choi


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
Code in certain sheets MAX Excel Worksheet Functions 1 February 6th 10 09:27 PM
Code to hide sheets Tia[_3_] Excel Worksheet Functions 0 July 8th 08 11:07 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
Vba code to print all sheets Arild Excel Programming 1 September 30th 03 12:19 PM
Same code in several sheets.. Soniya Excel Programming 1 September 11th 03 07:50 AM


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