+ Reply to Thread
Results 1 to 12 of 12

Returning TRUE instead of data

  1. #1
    Registered User
    Join Date
    03-04-2016
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    6

    Talking Returning TRUE instead of data

    Hello,

    I am currently programming a macro to read data from all the worksheets in the workbook and then transferring that data into another workbook that is the master list. Unfortunately it is returning TRUE instead of the actual data. Not sure how to fix this problem. Any help would be greatly appreciated!
    Below is the macro

    Please Login or Register  to view this content.
    Last edited by emilymerry; 03-07-2016 at 09:52 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Returning TRUE instead of data

    instead of:
    Please Login or Register  to view this content.
    try:
    Please Login or Register  to view this content.
    etc

  3. #3
    Registered User
    Join Date
    03-04-2016
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    6

    Re: Returning TRUE instead of data

    Now it runs without submitting TRUE but doesn't post anything..just flashes the range of data.

  4. #4
    Forum Contributor
    Join Date
    07-07-2014
    Location
    ericbartha.com
    MS-Off Ver
    2016 Professional
    Posts
    126

    Re: Returning TRUE instead of data

    ................................
    Last edited by ericbartha; 03-04-2016 at 04:20 PM.

  5. #5
    Registered User
    Join Date
    03-04-2016
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    6

    Re: Returning TRUE instead of data

    Hmmm I tried that but it came up with a error message saying its an invalid qualifier

  6. #6
    Registered User
    Join Date
    03-04-2016
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    6

    Re: Returning TRUE instead of data

    I tried this but its still just flashing the highlighted area where the data will go.

    Please Login or Register  to view this content.
    Last edited by FDibbins; 03-05-2016 at 02:34 PM.

  7. #7
    Forum Contributor
    Join Date
    07-07-2014
    Location
    ericbartha.com
    MS-Off Ver
    2016 Professional
    Posts
    126

    Re: Returning TRUE instead of data

    .............................
    Last edited by ericbartha; 03-04-2016 at 04:20 PM.

  8. #8
    Registered User
    Join Date
    03-04-2016
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    6

    Re: Returning TRUE instead of data

    I tried .Offset(RowCount, 0) = contract. Value but it came back as a compile error: invalid qualifier that's why I tried it with value before the = ..

  9. #9
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Returning TRUE instead of data

    I have not run this but would expect you to get values
    1 You need to refer to the sheet each time otherwise will pick up values from active sheet
    eg contract = sht.Range("H39")
    2 I have commented out some lines that are unneccesary
    Selection.Copy - you are assigning values not copying
    Worksheets("sheet1").Select - usually no need to select in VBA - just tell it what to do with cells
    Worksheets("sheet1").Range("A1:A" & Lrow).Select



    Please Login or Register  to view this content.

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Returning TRUE instead of data

    emilymerry forum rules require you to wait at least a day before "bumping your thread.

    Also, Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (I will add them for you - this time )
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  11. #11
    Registered User
    Join Date
    03-04-2016
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    6

    Re: Returning TRUE instead of data

    It worked Kevin! Thank you

    Sorry FDibbins, very new to this forum but I will make sure to follow the rules for future post.

  12. #12
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Returning TRUE instead of data

    You are welcome.
    Can you mark the thread as solved
    thanks

+ 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. IF statement returning TRUE value when looking at text
    By Oisin86 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-22-2016, 06:44 AM
  2. Replies: 1
    Last Post: 06-19-2015, 12:52 AM
  3. IF Stmt Returning a TRUE FALSE Value
    By J41 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-27-2014, 08:50 AM
  4. Returning True If Data Is in Range
    By aborg88 in forum Excel General
    Replies: 8
    Last Post: 07-06-2011, 11:20 AM
  5. Returning True/False/Maybe
    By RivFin in forum Excel General
    Replies: 1
    Last Post: 02-03-2011, 06:29 PM
  6. Returning a Value if 3 Conditions are True
    By brownie224 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-11-2006, 07:00 PM
  7. Replies: 6
    Last Post: 10-27-2005, 11:05 AM

Tags for this Thread

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