View Single Post
  #16   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default Make Macro go to Next Workseet

Probably.

It may be time again to post what you really want to do.

Michael from Austin wrote:

So, I can call a function in the place of "123"?

"Chip Pearson" wrote:

Michael,

In my code, setting a cell value to 123 was just placeholder
example code. You should replace it with whatever code you want.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Michael from Austin"
wrote in message
...
Cool. It doesn't error anymore, but it also does not go to the
next
worksheet. All it does now is add the value"123" to A2 on
worksheet 2 and
worksheet nth without actually going there?

"Chip Pearson" wrote:

"Worksheets" must be plural.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Michael from Austin"
wrote in message
...
Here is the code that I have entered.

Sub ChangeSheet()

' begins mac in sheet 1 cell a2
Dim Ndx As Integer
For Ndx = ActiveSheet.Index + 1 To
Worksheets(Worksheet.Count).Index
Worksheets(Ndx).Range("A1").Value = 123
Next Ndx

Call ForNextLoop



End Sub

This is the error:

Run-Time Error '424' Expected an Object

I get this on the following line..

For Ndx = ActiveSheet.Index + 1 To
Worksheets(Worksheet.Count).Index






"Michael from Austin" wrote:

I have a macro that I want to have also run on the next
worksheet and then
the next until there are no more worksheet. The worksheets
have names. I do
not want it to have to look for the name and then open it.
I
just want it to
go to the next one and then the next until the end... Can
this be done. Any
help would be appreceited.....
--
Regards,
Michael







--

Dave Peterson