+ Reply to Thread
Results 1 to 7 of 7

vba copy to cell with row number variable (like INDIRECT)

  1. #1
    Registered User
    Join Date
    11-25-2020
    Location
    Tauranga NZ
    MS-Off Ver
    2007
    Posts
    27

    vba copy to cell with row number variable (like INDIRECT)

    Hi there - just a newbie to VBA - use Indirect often but struggling with the VBA equivalent.
    I want to copy value in a cell(A3) to another cell column F with the row number of which is held in cell D5.
    VBA not impress with my effort as follows'-

    Range("A3").Value = Range("F" & D5).Value

    Error - "Method range of object - Global failed"

    any assistance appreciated
    cheers
    Chris

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: vba copy to cell with row number variable (like INDIRECT)

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Kind regards
    Leo

  3. #3
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: vba copy to cell with row number variable (like INDIRECT)

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-25-2020
    Location
    Tauranga NZ
    MS-Off Ver
    2007
    Posts
    27

    Re: vba copy to cell with row number variable (like INDIRECT)

    Thanks Leo - so quick & easy - Hopefully I will improve with time - I'm smiling = Chris

  5. #5
    Registered User
    Join Date
    11-25-2020
    Location
    Tauranga NZ
    MS-Off Ver
    2007
    Posts
    27

    Re: vba copy to cell with row number variable (like INDIRECT)

    Thanks BMV - so very quick - it's making me smile again - many thanks - Chris

  6. #6
    Registered User
    Join Date
    11-25-2020
    Location
    Tauranga NZ
    MS-Off Ver
    2007
    Posts
    27

    Re: vba copy to cell with row number variable (like INDIRECT)

    Hi BVM - how would the syntax change if copying a range(A3:A7) to a range(D5:D9) ?
    Hope you can help.
    cheers Chris

  7. #7
    Registered User
    Join Date
    11-25-2020
    Location
    Tauranga NZ
    MS-Off Ver
    2007
    Posts
    27

    Re: vba copy to cell with row number variable (like INDIRECT)

    Hi Leo - how would the syntax change if copying a range(A3:A7) to a range(D5:D9) ?
    Hope you can help.
    cheers Chris

+ 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. Replies: 2
    Last Post: 06-05-2021, 02:02 AM
  2. [SOLVED] Copy multiple columns x number of times based on variable number?
    By nobodyukno in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-19-2017, 04:13 PM
  3. Replies: 3
    Last Post: 02-17-2015, 11:53 PM
  4. Copy cell value to another cell with variable number of iterations
    By WeirnetherlandsBart in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-04-2014, 11:02 AM
  5. Replies: 2
    Last Post: 07-24-2012, 11:47 AM
  6. Replies: 2
    Last Post: 05-30-2012, 05:02 PM
  7. Replies: 7
    Last Post: 11-12-2010, 10:58 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