+ Reply to Thread
Results 1 to 5 of 5

Use variable to create cell address

  1. #1
    Registered User
    Join Date
    11-27-2014
    Location
    Midlands, UK
    MS-Off Ver
    2016
    Posts
    22

    Use variable to create cell address

    Apologies - I haven't done VBA in years and have got very rusty.

    I want to use the variable 'wordplace' to put the contents of C18 (some text) into cell R8 when a macro is run.
    'wordplace' starts at 0 and is incremented each time the macro is run. I have got that working.

    So the next time the macro runs, the contents of C18 go into R9, then R10, R11....
    I then have a column of words from R8 downwards.

    Can anyone help?

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Use variable to create cell address

    Please see yellow banner on how to attach a sample workbook.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Use variable to create cell address

    Please show the code you have so far. Show all of the code. Use CODE tags. Even better, just attach your file (see yellow banner at the top of the page)
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Use variable to create cell address

    Maybe
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    11-27-2014
    Location
    Midlands, UK
    MS-Off Ver
    2016
    Posts
    22

    Re: Use variable to create cell address

    Thanks Trevor, that worked perfectly!
    I made an Excel version of Wordle.

    wordle.jpg
    Last edited by 6StringJazzer; 02-05-2022 at 08:45 AM. Reason: fixed image attachment

+ 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. Use a variable as the row address of a cell
    By tomasball in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2021, 04:03 AM
  2. Use a variable as the row address of a cell
    By tomasball in forum Excel General
    Replies: 2
    Last Post: 11-16-2021, 07:27 PM
  3. [SOLVED] Set range address as variable and then clear the cell via the variable
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-13-2016, 02:23 PM
  4. [SOLVED] Assigning A Cell Address to A Variable, Using A Variable - Error '1003'
    By ch_abs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-28-2014, 01:36 PM
  5. Variable Cell Address
    By Trachr in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-07-2013, 05:53 PM
  6. Put cell address into a variable
    By pq927 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2010, 03:24 AM
  7. How can I use a variable as cell address?
    By Matt in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-27-2005, 04:05 PM

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