Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 04-09-2020, 07:12 PM
BobBridges's Avatar
BobBridges BobBridges is offline PASTE FORMULA from lookup table Windows 7 64bit PASTE FORMULA from lookup table Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Ok, I made one that actually works. In column O you put the various formulae the user wants to be applied, with a single quote in front so that Excel will know to treat that formula as the displayed value of the cell rather than a formula itself. And wherever there's a reference to the cell that has the filename, for example "A2", replace it with some unique text. I used "ZZ". Like this:
Code:
'=MID(ZZ,13,5)
That's for the formula. Your VBA statement gets the value from the correct cell in the table—you already know how to do that, I guess—and then uses the Replace function to change "ZZ" to "A2"-or-whatever, and assigns to the formula of the cell in column K. Like this, perhaps:
Code:
ows.Cells(jr, 11).Formula = Replace(ows.Cells(vr, 15).Value, "ZZ", "A" & jr)
...where jr is the row of the filename you're evaluating, and vr is the row number of the correct formula corresponding to the length of the filename.
Reply With Quote
 

Tags
paste formula lookup



Similar Threads
Thread Thread Starter Forum Replies Last Post
LOOKUP Formula error but WHY??? Haga Excel 1 04-17-2019 11:13 PM
N/A Value in Lookup Formula NickFazer Excel 2 04-02-2019 04:22 AM
How to update lastname with the help of V-Lookup formula? Mangesh1212 Excel 6 12-05-2018 02:15 AM
Need help with lookup formula tristanlau Excel 1 08-14-2017 07:16 AM
PASTE FORMULA from lookup table Lookup / Paste Multi Values VBA Mav Excel Programming 6 05-10-2015 08:42 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:52 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft