+ Reply to Thread
Results 1 to 6 of 6

a command to clear first selection

  1. #1
    Registered User
    Join Date
    08-05-2013
    Location
    borazjan
    MS-Off Ver
    Excel 2007
    Posts
    50

    a command to clear first selection

    i select a range(like A5:A8),then run the below macro,i want a command at the end of this macro to clear the first selection(A5:A8) content.what is that command?in other word, i want a command to select the first selection(A5:A8) and then clear their content.
    (A5:A8 is not exact and every time it is different)



    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: a command to clear first selection

    try to record the action of selecting the range and then clear its contents..so you will get the feel for it

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    37,209

    Re: a command to clear first selection

    Please Login or Register  to view this content.

    Regards, TMS

  4. #4
    Cheeky Forum Moderator Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: a command to clear first selection

    Try this:
    Please Login or Register  to view this content.
    Does that work?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Registered User
    Join Date
    08-05-2013
    Location
    borazjan
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: a command to clear first selection

    i know,if my selection was constant every time (like A5:A8),i can write " range("A5:A8").select" "selection.clearcontents"
    but my selection is different every time.i want a command to find and select the selection.

  6. #6
    Registered User
    Join Date
    08-05-2013
    Location
    borazjan
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: a command to clear first selection

    solved
    thanks

+ 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] can someone help modify the clear command to only clear columns from A-G?
    By psunursingguy21 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-30-2013, 03:52 PM
  2. Clear command button
    By slmi1313 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-27-2012, 06:01 AM
  3. Command Button - Clear
    By grkchakri in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2012, 12:39 AM
  4. Clear Contents Command
    By The Animal in forum Excel General
    Replies: 2
    Last Post: 09-13-2010, 05:30 PM
  5. Clear selection?
    By StargateFanFromWork in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-11-2006, 12:15 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