Chaitu235
asked on
Copy formula using VB code
The formula is there on the H column in the spreadheet.I am pasting data into the spreadsheet from another sheet using macro.We are pasting data from A to G columns.The formula on H will do a vlookup based on value in A column.
Is there a way to automate the formula to all the cells
For example if i pasted data on A to G in 20 rows .I need the formula on H to be from H1 to H20 automatically.
Please let me know.
Thanks,
Chaitu235
Is there a way to automate the formula to all the cells
For example if i pasted data on A to G in 20 rows .I need the formula on H to be from H1 to H20 automatically.
Please let me know.
Thanks,
Chaitu235
ASKER
Hi Can you please tell me where i should write this code..on worksheet_activate?
ASKER
I think you got my question wrong...
The code i am looking for is ..
I have formula on H3 column...The data on A through G columns will be results from a query .If query retured 20 rows ..
Data will be there from A3 through G on 20 rows. I want the formula on H3 to be copied to next 20 cells on H column.Please help me on that
The code i am looking for is ..
I have formula on H3 column...The data on A through G columns will be results from a query .If query retured 20 rows ..
Data will be there from A3 through G on 20 rows. I want the formula on H3 to be copied to next 20 cells on H column.Please help me on that
Can you attach a workbook that has the query results in it?
ASKER
Martin please find the Spreadsheet attached.Please let me know if you have any questions.
Question_on_Formula.xlsx
Question_on_Formula.xlsx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Range("H2:H" & Range("G1048576").End(xlUp
otherwise
Range("H1:H" & Range("G1048576").End(xlUp
where you would change the formula to suit.