#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 577
Default macro confusion

I am trying to create a macro that will perform the same function on
different tabs in a workbook, but whenever i try to run the macro for various
tabs, the macro defaults to the original tab that the macro was created in
and I end up getting an error message with options to end, debug, or cancel.
does anyone have suggestions to how i can fix this?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default macro confusion

Hi,

I suspect we may have more idea if we saw the macro.

Mike

"scott" wrote:

I am trying to create a macro that will perform the same function on
different tabs in a workbook, but whenever i try to run the macro for various
tabs, the macro defaults to the original tab that the macro was created in
and I end up getting an error message with options to end, debug, or cancel.
does anyone have suggestions to how i can fix this?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 577
Default macro confusion

I believe I deleted the macro because it wasn't working. Here is my
scenario. In a workbook I have a tab for each month of the year, and in each
tab I am using a 5-point moving average for data that is tabulated for each
day of the month. I also have a tab that summarizes each month, and the only
data that I am putting in that tab is the month, and overall average for each
month. Since the overall average in each tab lies in the same cell (h35), I
want a macro that can go to each tab, pull the value in h35, and return that
value to the summary tab for each respective month. Is this possible?
"Mike H" wrote:

Hi,

I suspect we may have more idea if we saw the macro.

Mike

"scott" wrote:

I am trying to create a macro that will perform the same function on
different tabs in a workbook, but whenever i try to run the macro for various
tabs, the macro defaults to the original tab that the macro was created in
and I end up getting an error message with options to end, debug, or cancel.
does anyone have suggestions to how i can fix this?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default macro confusion

dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.range("A1").value = "hi"
wks.range("b1").clearcontents
next wks

Make sure you qualify each range (or object or property or method) with "wks.".

scott wrote:

I am trying to create a macro that will perform the same function on
different tabs in a workbook, but whenever i try to run the macro for various
tabs, the macro defaults to the original tab that the macro was created in
and I end up getting an error message with options to end, debug, or cancel.
does anyone have suggestions to how i can fix this?


--

Dave Peterson
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
MDI Confusion CMoya Excel Discussion (Misc queries) 1 February 21st 08 02:11 PM
COUNTA Confusion.... [email protected] Excel Discussion (Misc queries) 8 January 31st 08 12:21 AM
Conditional Confusion [email protected] Excel Worksheet Functions 1 August 16th 07 03:36 PM
Formula confusion harry buggy Excel Worksheet Functions 4 August 2nd 07 05:22 AM
Confusion..... Eric @ CMN, Evansville Excel Discussion (Misc queries) 2 December 27th 05 07:15 PM


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