+ Reply to Thread
Results 1 to 5 of 5

Select until character

  1. #1
    Registered User
    Join Date
    04-11-2012
    Location
    Stoke, England
    MS-Off Ver
    Ms 365
    Posts
    68

    Select until character

    Hi

    Could someone help in tweaking my macro, Currently it selects "a1 to x7" and runs which if fine unless my data has less lines, The data i have always finishes with an hyphen on the row below the data i require to copy. I need my macro to select the range upto and including the first instance of the hyphen if thats possible.

    Any help greatly appreciated


    Works

    A1 02/09/2021
    A2 02/09/2021
    A3 02/09/2021
    A4 02/09/2021
    A5 02/09/2021
    A6 02/09/2021
    A7 -

    Doesn't work

    A1 02/09/2021
    A2 02/09/2021
    A3 02/09/2021
    A4 02/09/2021
    A5 -

    A1 02/09/2021
    A2 02/09/2021
    A3 02/09/2021
    A4 02/09/2021
    A5 02/09/2021
    A6 02/09/2021
    A7 -


    Please Login or Register  to view this content.
    Last edited by hazzaska; 02-09-2021 at 10:55 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Select until character

    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.)

  3. #3
    Registered User
    Join Date
    04-11-2012
    Location
    Stoke, England
    MS-Off Ver
    Ms 365
    Posts
    68

    Re: Select until character

    Quote Originally Posted by 6StringJazzer View Post
    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.)
    Sorry about that all i have edited as requested.

    Thanks

    H

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,884

    Re: Select until character

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    04-11-2012
    Location
    Stoke, England
    MS-Off Ver
    Ms 365
    Posts
    68

    Re: Select until character


+ 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. ADODB SELECT FROM filename with special character imbedded
    By eadamy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2018, 01:45 AM
  2. Select From right to left untill character is hit
    By lemunk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-08-2016, 08:26 AM
  3. [SOLVED] Quick Question: Select Case to identify if first character of a cell is "6"
    By exlgh91 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2013, 10:25 AM
  4. Select only first character from a label
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2012, 04:55 AM
  5. How to select up to a certain character?
    By Mark53 in forum Excel General
    Replies: 3
    Last Post: 04-13-2011, 05:15 AM
  6. Select cell contents after a certain character in a cell
    By fatboyslim007 in forum Excel General
    Replies: 2
    Last Post: 02-14-2008, 08:43 PM
  7. [SOLVED] find and select all cells with a alphabetic character
    By Giz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2005, 02:05 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