Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automation Macro for updating formula when changing cell value | Excel Discussion (Misc queries) | |||
Automation Macro for updating formula when changing cell value | Excel Discussion (Misc queries) | |||
Formula Problem in Macro | Excel Discussion (Misc queries) | |||
Problem with summing formula updating Total... | Excel Discussion (Misc queries) | |||
Excel/macro Formula Problem! | Excel Programming |