+ Reply to Thread
Results 1 to 14 of 14

Select from cell A to the last data (right position) but skip Blank Cell

  1. #1
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Select from cell A to the last data (right position) but skip Blank Cell

    hi all...

    how to make macro code can work to select range in active sheet start from cell A "going to" right to the last data but skip blank cell
    then copy too..then the file can save as .xlam (add in)
    this basic code but i don't know make it
    Please Login or Register  to view this content.
    or other code

    thank in advance..

    john m

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    Try
    Sub Maybe()
    Range(Cells(1, 1), Cells(1, Cells(1, Columns.Count).End(xlToLeft).Column)).SpecialCells(2).Select
    End Sub

  3. #3
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    Quote Originally Posted by jolivanes View Post
    Try
    Sub Maybe()
    Range(Cells(1, 1), Cells(1, Cells(1, Columns.Count).End(xlToLeft).Column)).SpecialCells(2).Select
    End Sub
    hi jolivanes, almost done
    please, see my picture for comparingAttachment 698239
    note:
    1. if it's possible can adding code to select and copy simultance in single code
    2. can save as .xlam (add in), running as add in
    Last edited by Jhon Mustofa; 10-05-2020 at 01:49 AM.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    Please Login or Register  to view this content.
    I don't know anything about .xlam files. There are lots of questions and hence answers on these sites. I just use Personal.xlsb for that.
    To attach a workbook you'll need to go to the bottom and select "Go Advanced" and follow instructions.

  5. #5
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    hi jolivanes...sorry i'm missing it..
    please, don't use copy code
    i mean ONLY select NOT copy simultance
    like my attachment picture

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    The code in Post #2 selects as requested.
    Can't open your attachment in Post #3.
    Attach files as mentioned in Post #4

  7. #7
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    here my attachment file
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    What happened to this "but skip blank cell"?

    Just leave the "SpecialCells" part out.
    Please Login or Register  to view this content.
    Last edited by jolivanes; 10-05-2020 at 02:13 PM.

  9. #9
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    hi...your code only work in row 2..
    how to make it work in any row such as in row 3,row 15 ,row 100, etc...

  10. #10
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    How are you deciding which row?

  11. #11
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    my data not always in single row. sometimes select row 2 ,sometime select row 3, etc...can't default row

  12. #12
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    You're not answering my question.
    What determines which row to select?
    Now it sounds like you want to maybe select multiple rows. If so, which row will determine the last column?
    Or do you select a cell in a row and select that one?

    Select any cell in a row with data and run this macro.
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    hi.. i just select that one.
    your macro code working well, that's i want it..
    Perfecto..Thank you so much!!!

  14. #14
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Select from cell A to the last data (right position) but skip Blank Cell

    Glad to hear you have it under control
    Terima kasih banyak and Good Luck

+ 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] Randomly Select Cells In Column That Contain Data - Skip The Blank Cells
    By Logit in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-18-2018, 07:54 AM
  2. Tell macro to skip blank cells in a range and only select those with data?
    By Belinea2010 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-15-2016, 08:33 PM
  3. [SOLVED] How to position the cursor on a cell (cell focus) *without* using Select
    By NJDevil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-16-2016, 11:34 AM
  4. [SOLVED] Formula to Copy/Paste data based on value of another cell. SKIP BLANK ROWS.
    By mamero in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-14-2015, 04:46 PM
  5. If cell contains blank, skip cell (Run Time Error 13)
    By eatsox117 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-25-2010, 11:46 AM
  6. skip cell if blank go on to use another cell in calculation
    By sosborne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-08-2006, 05:35 PM
  7. Select last blank cell in a range of data
    By DJ Dusty in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2006, 01:23 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