Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 04-08-2020, 08:38 AM
NoSparks NoSparks is offline PASTE FORMULA from lookup table Windows 10 PASTE FORMULA from lookup table Office 2010
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

VBA and no lookup table
Code:
Sub Test_1()
    Dim rng As Range, cel As Range
    Dim startpoint As Long
    
    With Sheets("51batch")
        Set rng = .Range("A2", .Range("A" & Rows.Count).End(xlUp))
        For Each cel In rng
            startpoint = InStrRev(cel, "_") + 2
            'for test purposes write formula to column "K"
            cel.Offset(, 10) = "=Mid(" & cel.Address & "," & startpoint & ", 5)"
        Next cel
    End With
End Sub
Assuming that works...
Consulting my buddy Google lead to this array entered formula without any vba
=MID(A2,FIND("~",SUBSTITUTE(A2,"_","~",(LEN(A2)-LEN(SUBSTITUTE(A2,"_","")))/LEN("_")))+2,5)
I must confess I don't understand it but the establishing of where to find the last underscore comes from an old posting by the very knowledgeable Tom Ogilvy

Last edited by NoSparks; 04-08-2020 at 11:39 AM. Reason: to add the formula part
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 07:19 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