+ Reply to Thread
Results 1 to 9 of 9

VBA to make the formula to value

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    VBA to make the formula to value

    Hi,

    Is there a way to make the data appear in values and not in formula?

    Range("D26").FormulaR1C1 = "=VLOOKUP(R[-24]C,DATA!C1:C50,26,0)"
    i am aware of .value = .value. But what i am trying to do if there is an alternative to FormulaR1C1 ?
    Keep the Forum clean :


    1. Use [ code ] code tags [ /code ]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. Show appreciation to those who have helped you by clicking * Add Reputation below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: VBA to make the formula to value

    Something like this...Untested...Not sure what the lookup criteria is...

    Range("D26") = Application.WorksheetFunction.VLookup("whattolookup", Sheets("DATA").Range("C1:C50"), 1, False)
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to make the formula to value

    Thank you sintek.

    I tried, but am getting error msg as Runtime error 1004, Unable to get the vlookup property of the worksheetfunction class.

    whattolookup = Sheets("MAIN").Range("D2").Value
    Sheets("MAIN").Range("D7") = Application.WorksheetFunction.VLookup("whattolookup", Sheets("DATA").Range("C1:C50"), 2, False)
    Last edited by shiva_reshs; 07-23-2019 at 05:54 AM.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: VBA to make the formula to value

    "whattolookup"
    remove quotation marks
    And this range not correct....
    Range("C1:C50"), 2
    2nd column in only 1 col range...
    Last edited by sintek; 07-23-2019 at 05:59 AM.

  5. #5
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to make the formula to value

    Did. Still same error msg.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: VBA to make the formula to value

    Upload your sample file...

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this !


    Quote Originally Posted by shiva_reshs View Post
    if there is an alternative to FormulaR1C1 ?
    Yes just using directly the formula ! [D26].Value2 = [VLOOKUP(D2,DATA!$A:$AX,26,0)]

  8. #8
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to make the formula to value

    Thank you Sintek and Marc for helping out. Solved.

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: VBA to make the formula to value

    Glad you got it sorted...
    Long way you get not figure out would have been...
    Sub Vlookup()
    Range("D26") = Application.WorksheetFunction.Vlookup(Sheets("Data").Range("D2").Value, Sheets("Data").Range("A:Z"), 26, False)
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Help with advanced LEN and Substitute formula to make a special rule in formula
    By Kron in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-07-2017, 12:23 PM
  2. Replies: 6
    Last Post: 01-04-2017, 11:20 AM
  3. How to make this formula in excell sheet..please help me to make this..
    By mdinesh223 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-13-2015, 05:01 AM
  4. [SOLVED] Make formula disregard other formula entry if blank
    By DHFE in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-06-2014, 04:23 AM
  5. Alternative Formula for multiples IFs (to make my formula shorter)
    By chico.corrales in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-07-2013, 12:37 AM
  6. [SOLVED] Formula whit INDEX and MATCH. I try to make this formula to result.
    By Anka in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-28-2012, 06:26 PM
  7. Replies: 7
    Last Post: 03-25-2011, 02:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1