LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
tim tim is offline
external usenet poster
 
Posts: 105
Default Macro Formula Updating Problem

In a workbook I have 2 sheets. I use a macro to transfer the data from acolumn in sheet 1 to a row in sheet 2. The data that is transfered to sheet 2 is a list of names and info for each one. What happens i
1) I run a macro to setup the sheets how I want them
a) This macro sets up sheet 1 with the info i want in sheet 1 and uses that same info as headings on sheet 2
b) The macro also sets up on sheet 1 a formula to count how many names there are on sheet 2. (I think this is where
the problem is.)
2) I use a second macro to take the data that the user inputs on sheet 1 and transfers it to sheet 2. The data moved by this
is what i want to count
The reason I need to count the number of names is that when I use the second macro, I needed a way to specify the next blank row (i.e. 2 rows are for headings, and then if there is info in a row , then go to row #ofnames+2(headings)+1(for the next row)
Here is the problem
The formula that I use to calculate the number of names currently is =(CountA('Sheet 2'!A:A))-2. This should return 0, because there A1 and A2 are full (they are the headings) and there is no more info. If I manually input the formula into a cell it works fine. However, when the macro initially inputs the formula it gives -1 as the answer. Then if I add names to sheet 2 it stays at -1, but the manually entered formula counts properly

What can I do to fix this? Or is there a better way to do what I want?
 
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
Automation Macro for updating formula when changing cell value Danny Excel Discussion (Misc queries) 2 August 17th 07 02:22 AM
Automation Macro for updating formula when changing cell value Danny Excel Discussion (Misc queries) 0 August 17th 07 01:47 AM
Formula Problem in Macro [email protected] Excel Discussion (Misc queries) 2 April 4th 07 09:49 PM
Problem with summing formula updating Total... Dave Excel Discussion (Misc queries) 2 November 21st 06 05:46 PM
Excel/macro Formula Problem! nic17 Excel Programming 5 June 3rd 04 06:22 PM


All times are GMT +1. The time now is 01:29 AM.

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

About Us

"It's about Microsoft Excel"