Home |
Search |
Today's Posts |
#12
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Rows added after refresh not in formula
these 2 lines of code find the last row of data in column C (just guessing
that this was one of the columns populated by SQL - if not, change the column letter), assigning the row number to the variable lrow dim lrow as long lrow = Range("c65256").End(xlUp).Row If you change this code (which places your F6*$G$5 formula in every row of column A from row 6 to the last row of data in column C) Range("a6", "a" & lrow).FormulaR1C1 = "= rc6*r5c7" to Range("G6", "G" & lrow).FormulaR1C1 = "= rc6*r5c7" It will put the formula in col G. Is there a possibility of rows coming back from SQL with a null value in A, and then you don't want the formula to appear in column G? Then use Range("G6", "G" & lrow).FormulaR1C1 = "= if(rc1="","",rc6*r5c7)" "Greg Snidow" wrote: Thanks Duke, but I am confused. Are you saying that something would be populated in column A? This is not what I need. Column A is a job# that comes from the SQL view. What I need is for the formulas in certain columns, G, in my example to exist in all rows in column G where there is a job# in A. If that is what you are trying to tell me I do not understand. Does any of this make sense? If not let me know, as I do not know the lingo you all use to get my point across. "Duke Carey" wrote: Well, to address your question about copying the formula in a macro, you can determine the last row of data by doing something like this dim lrow as long lrow = Range("c65256").End(xlUp).Row and then this will populate column A, starting in row 6, with the =F6*$G$5 formula Range("a6", "a" & lrow).FormulaR1C1 = "= rc6*r5c7" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
resetting last cell | Excel Discussion (Misc queries) | |||
Match then lookup | Excel Worksheet Functions | |||
Formula checking multiple worksheets | Excel Worksheet Functions | |||
Formula checking multiple worksheets | Excel Worksheet Functions | |||
Insert rows, keep a formula? | Excel Worksheet Functions |