+ Reply to Thread
Results 1 to 6 of 6

Macro not copying the values retrieved in the variable in code

  1. #1
    Registered User
    Join Date
    11-01-2018
    Location
    Melb
    MS-Off Ver
    2013
    Posts
    3

    Macro not copying the values retrieved in the variable in code

    The value retrieved on both sides of below equation are correct as checked by Watch Window:
    Please Login or Register  to view this content.
    But the value posted in the excel Cells(Row, Column + 1) is 0
    Last edited by AliGW; 11-01-2018 at 04:20 AM. Reason: Code tags added.

  2. #2
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: Macro not copying the values retrieved in the variable in code

    try

    Please Login or Register  to view this content.
    Last edited by mohan.r1980; 11-01-2018 at 04:21 AM.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Macro not copying the values retrieved in the variable in code

    Perhaps
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-01-2018
    Location
    Melb
    MS-Off Ver
    2013
    Posts
    3

    Re: Macro not copying the values retrieved in the variable in code

    No these did not help , the exact query is:
    .Cells(iRow, iColumn + 29).Value = rsData!Variable_Six

    where rsData is the recordset
    and .Cells(iRow, iColumn + 29) is the location in excel where it is trying to write

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Macro not copying the values retrieved in the variable in code

    Nobody can read your brain.

    What do you expect us from such a little information?

    Last guess

    Google "CopyFromRecordset"

  6. #6
    Registered User
    Join Date
    11-01-2018
    Location
    Melb
    MS-Off Ver
    2013
    Posts
    3

    Re: Macro not copying the values retrieved in the variable in code

    ok I will try that - Well this equation runs inside a loop where the column number is increased by 1 every time.
    For each column it is working fine except I think the situation arises in copying in the last 2 columns- but even then the watch and immediate windows showed correct value. The issue was only when 0 value got pasted into intended excel cell.

+ 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] How to use the column header to retrieved values from a table
    By MyStix01 in forum Excel General
    Replies: 2
    Last Post: 05-18-2018, 12:24 AM
  2. Macro Code problem when Copying Selected (variable) cells with filters
    By sx200n in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2015, 06:55 AM
  3. [SOLVED] Macro for copying values and pasting it for variable rows
    By Anonym216 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-24-2013, 04:43 AM
  4. Code do not recognize retrieved value
    By score in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2013, 09:27 PM
  5. Code tweak needed: Copy macro not copying formats only values (with getobject)
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-19-2012, 01:06 PM
  6. Copying Variable to field crashes code
    By technoyogi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2011, 08:14 AM
  7. Store variable values in macro code
    By Jacques Grobler in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2011, 05:35 AM

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