+ Reply to Thread
Results 1 to 4 of 4

Copy to Dynamic Column

  1. #1
    Registered User
    Join Date
    02-15-2015
    Location
    Adelaide
    MS-Off Ver
    2010
    Posts
    2

    Copy to Dynamic Column

    Hi,

    Row 5 can be dynamic, the last column in Row 5 can be different

    In Sheet 2, I want to copy A6:B17 then auto fill C6: this is were I am getting into trouble, how can I paste to the last column used, this defined by the last cell used in row 5.

    For example, AB5 is the last cell.

    I would then want to auto fill C6:AB6

    BZ5 is the last cell.

    I would then want to auto fill C6:BZ6

    Any help appreciated.

    Len55

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Copy to Dynamic Column

    req deleted
    Last edited by protonLeah; 02-15-2015 at 04:00 PM.
    Ben Van Johnson

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Copy to Dynamic Column

    Hi Lens

    Using some VBA code the last used cell in Row5 is:

    LastCol = Cells(5,Columns.Count).End(xlToLeft).Column
    Cells(5,LastCol).Select

    The above two lines will put your cursor in the last column in row 5 that has data in it.
    It is the same as going to a cell beyond your data (to the right) in row 5 and pressing Ctrl+Left Arrow.

    Read this link for more:
    http://spreadsheetpage.com/index.php...e_size_ranges/
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    02-15-2015
    Location
    Adelaide
    MS-Off Ver
    2010
    Posts
    2

    Re: Copy to Dynamic Column

    Hi Marvinp,

    Thanks, unfortunately I do not know that much about VBa, is it possible to be able to put the code into the scenario I am after'

    Thank

+ 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. How VBA to copy the dynamic of Grand Total column
    By owen_yuen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-16-2014, 12:59 PM
  2. VBA to copy and paste at last column -1 with Dynamic columns
    By outlook888 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2013, 11:50 AM
  3. [SOLVED] Macro to copy/paste cell into same column down a dynamic number of rows
    By rdowney79 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-31-2013, 03:03 PM
  4. [SOLVED] dynamic column reference, copy formula down
    By intothewild in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-03-2012, 06:19 PM
  5. VBA Copy Column data based on multiple dynamic criteria
    By rotolytics in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-19-2011, 07:26 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