+ Reply to Thread
Results 1 to 3 of 3

Macro - Cant retrieve value from other WB

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-18-2012
    Location
    Sweden
    MS-Off Ver
    Office 2016
    Posts
    158

    Macro - Cant retrieve value from other WB

    Hi!

    I have a Macro that is currently running like this:

    .Range("B2").Formula = wb.Worksheets("3").Range("D18").Formula
    .Range("B3").Formula = wb.Worksheets("3").Range("D19").Formula
    .Range("B4").Formula = wb.Worksheets("3").Range("L18").Formula

    This works great for the first 2 (D18 and 19) Since I manually enter those 2 values in the file when filling it out. However for the last one L18 I use this formula in the file: =SUM(M5:M16) and the result for my macro for B4 from L18 becomes 0 (it returns the formula from the other WB (=SUM(M5:M16). I tried just doing a =L18 on another cell and then use that to grab the info from but same issue happens.

    What can I do so the macro can handle a formula result?


    Thanks in Advance!
    Last edited by Vihral; 11-25-2013 at 10:52 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro - Cant retrieve value from other WB

    If I am understanding you correctly, you want the value in L18 on the other workbook, not the formula? In which case:
    .Range("B4").value = wb.Worksheets("3").Range("L18").value

  3. #3
    Forum Contributor
    Join Date
    12-18-2012
    Location
    Sweden
    MS-Off Ver
    Office 2016
    Posts
    158

    Re: Macro - Cant retrieve value from other WB

    Quote Originally Posted by yudlugar View Post
    If I am understanding you correctly, you want the value in L18 on the other workbook, not the formula? In which case:
    .Range("B4").value = wb.Worksheets("3").Range("L18").value
    That was a lot easier then I had through. Should always look into the simple things first. Thank you very much! Works great!

+ 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. Macro: Retrieve value from website
    By Tian1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2013, 02:47 PM
  2. How do I program a macro to do an essbase retrieve?
    By Duncan Haines in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-26-2012, 05:37 AM
  3. macro to retrieve data from another worksheet
    By jartzh in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-12-2010, 03:30 AM
  4. Macro to retrieve data from different spreadsheets
    By bobs1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2010, 07:51 PM
  5. Macro to retrieve user information
    By Randy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-03-2006, 01:40 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