+ Reply to Thread
Results 1 to 3 of 3

Alter manual selection to a set range in macro

  1. #1
    Registered User
    Join Date
    10-26-2018
    Location
    Bristol, England
    MS-Off Ver
    Microsoft office professional 2016
    Posts
    6

    Alter manual selection to a set range in macro

    I have been using a macro that adds quotation marks onto either side of the value in a cell to export it as a text file, however it requires me to manually select the values I wish to export and then run the macro. I would like it to just use a set range of values i.e. A1:L4. This is too complicated a task for my very limited knowledge of basic. Any help would be much appreciated! The code is as follows:
    Please Login or Register  to view this content.
    Last edited by alansidman; 10-26-2018 at 01:46 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Alter manual selection to a set range in 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.)
    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

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Alter manual selection to a set range in macro

    The easiest (quickest) way would be to just Select your new range right before the RowCount loop starts:

    Please Login or Register  to view this content.
    Otherwise Dim a varialbe as a range "myRng" for example, and then Set that variable to be Range("A1:L4"). Then replace "Selection" with "myRng"
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

+ 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] Manual selection of a Row and copy data to another sheet
    By bluesurger in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-23-2014, 04:36 AM
  2. Alter Chart Axis Label Number Format According to Language Selection
    By cocucraf in forum Excel Charting & Pivots
    Replies: 9
    Last Post: 07-17-2009, 06:04 AM
  3. copy manual selection, then paste
    By iturnrocks in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-29-2007, 11:00 PM
  4. Setting a specific cell selection to manual
    By Serge in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2006, 08:25 PM
  5. Diff. in manual entry and list selection
    By Mangesh Yadav in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2005, 02:05 AM
  6. Macro with manual file selection?
    By Pmedina in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2005, 05:50 PM
  7. VBA to alter selection in a Drop Down Box
    By Darin Kramer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2005, 11:06 AM

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