+ Reply to Thread
Results 1 to 5 of 5

Need help adjusting a row reference in a macro

  1. #1
    Registered User
    Join Date
    12-31-2015
    Location
    Orlando, FL
    MS-Off Ver
    2016
    Posts
    15

    Need help adjusting a row reference in a macro

    My current macro includes this line:

    Range("A2:A" & LastRow).SpecialCells(xlCellTypeVisible).EntireRow.Copy

    For each row selected, it copies the entire row. I need to change this line so that it copies only A through R in that row. So I need to replace "EntireRow" to what? Or some other change?

    The entire macro is below, thanks!

    Please Login or Register  to view this content.
    Last edited by Richard Buttrey; 12-20-2018 at 12:51 PM. Reason: code tags added

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need help adjusting a row reference in a macro

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    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, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need help adjusting a row reference in a macro

    Untested in the absence of the workbook but try

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-31-2015
    Location
    Orlando, FL
    MS-Off Ver
    2016
    Posts
    15

    Re: Need help adjusting a row reference in a macro

    That worked perfectly, and thanks also for the reminder about how to pose code!

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need help adjusting a row reference in a macro

    My pleasure

+ 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. Adjusting entire column of formulas by adding additional cell reference
    By lukelucky in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-19-2016, 10:19 AM
  2. HELP PLEASE on Auto-Adjusting Reference
    By wedzmer in forum Excel General
    Replies: 14
    Last Post: 08-05-2014, 10:32 AM
  3. how to stop auto adjusting formulas when insert reference column
    By mystockpick in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-01-2014, 11:47 PM
  4. [SOLVED] Need some help adjusting a macro
    By dreddster in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-15-2014, 05:36 AM
  5. Adjusting Excel formulia from reference cells
    By JimB. in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-23-2012, 01:40 PM
  6. Need little help for macro adjusting :)
    By xwishmasterx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2010, 11:15 AM
  7. Adjusting Macro
    By PeterDV in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-29-2008, 07:23 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