+ Reply to Thread
Results 1 to 3 of 3

Set a variable as ActiveCell in Excel VBA

  1. #1
    Registered User
    Join Date
    07-23-2019
    Location
    TW
    MS-Off Ver
    2016
    Posts
    12

    Set a variable as ActiveCell in Excel VBA

    "SOLVED"

    I am copying tables from a word .docx file into an excel sheet.

    My code below works fine, however, my issue is that I want to set my resultRow variable to be the ActiveCell.row instead of a fixed integer. So that I can paste my table into an active cell rather than a defined cell range. I have tried changing it to resultRow = ActiveCell and Set resultRow = ActiveCell but they are not working. Any help is appreciated. My code is shown below:

    Please Login or Register  to view this content.
    Last edited by AAS44; 05-22-2020 at 02:58 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    19,656

    Re: Set a variable as ActiveCell in Excel VBA

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between 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. No help to be offered until this moderation request has been fulfilled.)

    You can use the builtin Activecell object
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    07-23-2019
    Location
    TW
    MS-Off Ver
    2016
    Posts
    12

    Re: Set a variable as ActiveCell in Excel VBA

    Thanks!! You are right!!

+ 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] Variable in ActiveCell.FormulaR1C1?
    By russwongg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-18-2016, 10:56 PM
  2. [SOLVED] Variable for sheet name in vba ActiveCell.Formula
    By bstier in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2015, 10:49 PM
  3. Selecting a range of cells using ActiveCell where the start point is variable
    By jshaw82 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2013, 05:54 AM
  4. Output contents of Activecell when Activecell may be string or numeric.
    By jfriddle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2012, 12:27 PM
  5. Activecell offset with Variable
    By sgreni in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2011, 05:42 PM
  6. Countif with activecell.row variable for range?
    By JP Romano in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2011, 11:45 AM
  7. How to use ActiveCell Adress in variable?
    By Castor77 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-11-2010, 11:28 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