+ Reply to Thread
Results 1 to 4 of 4

Use a variable as the row address of a cell

  1. #1
    Registered User
    Join Date
    11-16-2021
    Location
    New Mexico
    MS-Off Ver
    2016
    Posts
    1

    Use a variable as the row address of a cell

    I hope I can explain my question. Can I write a code for a command button that says something like:
    Please Login or Register  to view this content.

    ...now, I realize that won't work as written, but is there some way to use a variable as the row address of a cell?

    Thanks for your patience
    Last edited by AliGW; 11-17-2021 at 03:59 AM. Reason: Title changed - please think more carefully about your thread titles in future!

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: variables

    You have two options. Using your original example you could have:

    Please Login or Register  to view this content.
    Or you can use the Cells() method to specify the row and column:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: variables

    Administrative Note:

    Welcome to the forum.

    Please use the Code Tags from now on.


    Please Login or Register  to view this content.
    Last edited by AliGW; 11-17-2021 at 04:04 AM. Reason: Moderation request removed. Gurus & experts have been instructed to leave the moderating to mods & admins. Thanks.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,418

    Re: Use a variable as the row address of a cell

    Administrative Note:

    Welcome to the forum.

    Your thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you are new here, I have done it for you today.)

    Administrative Note:

    You need to include code tags around your code.

    Please take a moment to add the tags. 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, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then 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

    (Note: this change is not optional. As you are new here, I have done it for you today.)

    Thread moved to the VBA section.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] [Windows Environment Variables] Change user variables using VBA
    By alexgoaga in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-29-2018, 09:06 PM
  2. Storing variables as string or as variables in array performance
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2017, 08:35 AM
  3. [SOLVED] finding an output from 5 variables in an array using exterior input user variables
    By Allsort in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-09-2013, 11:16 AM
  4. Replies: 3
    Last Post: 09-11-2012, 02:03 AM
  5. macro that finds variables in one column and enters values if variables found
    By xln00b in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-07-2010, 08:22 AM
  6. Multiple variables:bunch of variables
    By sbq80 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-19-2009, 04:22 PM
  7. Unzip Code - Works without Variables, Breaks with Variables...
    By AdamParker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-06-2009, 02:35 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