I am looking for a macro to allow me to insert multiple vlookups onto a spreadsheet which is utilised as a template. My template basically creates another sheet and transfers the data as well, thereafter clears the selected range from the template thereby also removing the formulas as well. I would like a macro that would reinsert these formulas. I tried to record a macro by physically inserting the formulas one by one but I get a run time error. The recorded macro is below
PHP Code:
Option Explicit
Sub Insert_Formulas()
'
' Insert_Formulas Macro
'
Office 365, Excel for Windows 2010 & Excel for Mac
Posts
29,464
Re: Multiple to insert multiple vlookup formulas
Hi,
The workbook would be more useful, particularly since we don't know what the active cell was at the time you recorded the macro.
In any case, ignore the macro you have. Recorded macros are occosionally a useful starting point, but they always need editing and modifying to make them truly workable.
Tell us exactly what you are trying to do in a narrative form. It appears that you are wanting to enter one or more VLOOKUP formula in several cells. Tell us what the formulae are attempting to do and where you expect them to be placed. And if this is not always the same place, what rules should be used for placing the formulae
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
Please find attached,basically it the sheet has look ups to another summary sheet (Pro Forma Invoice Summary) from which it extracts the information and compares this to the LC data inputted into Column C. Prior I had two macros, one to move to copy data to another sheet and another to clear cells. Formulas are also included in the cells as comments and want these to be automatically inserted.
I have changed the macro since, thou I am having an error on the spreadsheet and made a note in the document. The idea now is that the sheet is duplicated then moved to the archive workbook behind the summary sheet and stored there, a PDF is created, named and stored in separate location and the template files is then closed.
Your advise on the volookups message will be most appreciated. Placing of formulas will not change.
Last edited by Rid1; 01-16-2014 at 03:47 PM.
Reason: correct request
Bookmarks