+ Reply to Thread
Results 1 to 4 of 4

Utilizing cells only containing data

  1. #1
    Registered User
    Join Date
    06-02-2010
    Location
    Hometown, Texas
    MS-Off Ver
    Excel 2003
    Posts
    23

    Utilizing cells only containing data

    In my recorded Macros, when I select a range with the mouse (i.e. A1:H1), and use the F8, CTL+Down, selecting all the rows containing data within the range, the VBA code generated is:

    Please Login or Register  to view this content.
    How is this same result achieved without the use of the 'Select' method?

    For example, if I wanted to clear the contents off all cells/rows within the range, how would I do this without the Selection method?
    Last edited by Screamtruth; 06-07-2010 at 01:12 PM.
    Of all tyrannies, a tyranny exercised "for the good of its victims" may be the most oppressive.
    --C. S. Lewis

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Utilizing cells only containing data

    How about:

    Please Login or Register  to view this content.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Utilizing cells only containing data

    Please Login or Register  to view this content.
    When you recorded the macro, you did it in 2 steps
    1) Select cells
    2) Select a range that includes those cells


    To do the exact same thing in 1 step
    Please Login or Register  to view this content.


    But you don't have to select the range, you can do anything you want with the range
    So to clear the range:
    Please Login or Register  to view this content.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  4. #4
    Registered User
    Join Date
    06-02-2010
    Location
    Hometown, Texas
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Utilizing cells only containing data

    Very nice,

    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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