+ Reply to Thread
Results 1 to 7 of 7

Allow user to define range for Text to Column

  1. #1
    Forum Contributor
    Join Date
    10-28-2003
    Location
    Happyville, USA
    MS-Off Ver
    365
    Posts
    300

    Allow user to define range for Text to Column

    Hello everyone,

    I am looking to build a simple macro performs a text to column function. See below:

    HTML Code: 
    It works well enough but I want to be able to highlight any range I want and then use the macro. For example with a paste special macro I can just use "Selection.Copy" and that macro will perform the function on any range that I highlight. How can I do the same with the macro above?

    Thanks

    Eddie
    Last edited by punter; 08-25-2014 at 04:26 PM.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Allow user to define range for Text to Column

    Will the destination change based on what you have highlighted?

    It seems like the solution you posted fits your problem.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Contributor
    Join Date
    10-28-2003
    Location
    Happyville, USA
    MS-Off Ver
    365
    Posts
    300

    Re: Allow user to define range for Text to Column

    Thank you for the reply.

    Wouldn't I need to change something with the destination range?

    I am not sure what solution I posted that you are referring to. It might be right in front of me and I'm not seeing it.

    Thank you so much for your help. I look forward to your response.

    Eddie

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Allow user to define range for Text to Column

    Eddie

    Where would you want the results to go?

    Also, will all the parameters/settings, eg delimiters etc, be the same every time?
    If posting code please use code tags, see here.

  5. #5
    Forum Contributor
    Join Date
    10-28-2003
    Location
    Happyville, USA
    MS-Off Ver
    365
    Posts
    300

    Re: Allow user to define range for Text to Column

    I would want the results to stay in the same column as the data. I am just looking to eliminate everything after the "#".

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Allow user to define range for Text to Column

    I was thinking more about row than column.

    In the example you posted, if you wanted the results to end up to end up in the first row of the selection you could use Selection.Cells(1,1) for Destination.

  7. #7
    Forum Contributor
    Join Date
    10-28-2003
    Location
    Happyville, USA
    MS-Off Ver
    365
    Posts
    300

    Re: Allow user to define range for Text to Column

    That worked great. Thanks so much.

+ 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] Define new range names based on existing range name offset 1 column to right
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-03-2014, 07:53 PM
  2. Getting error user define type not define
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-26-2013, 10:55 PM
  3. Define named range where user can define size
    By nahousto in forum Excel General
    Replies: 4
    Last Post: 07-06-2009, 05:09 PM
  4. Define a Column Range
    By drew138 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2009, 04:34 PM
  5. Macro to define name range based on user input
    By truongn2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-03-2007, 08:53 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