+ Reply to Thread
Results 1 to 3 of 3

Apply macro only to a range of cells

  1. #1
    Registered User
    Join Date
    10-15-2012
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    22

    Apply macro only to a range of cells

    Hey Guys,

    Easy fix anticipated here, fingers crossed. I have a working macro that takes out all rows that contain a "0". However, I want a new one to only apply to a range of cells A20:f150. The new macro will be called DeleteBlanks.

    Can anyone help by rewriting the code for me?

    Thanks
    Alasdair

    Please Login or Register  to view this content.
    Last edited by aloconnor; 07-10-2014 at 11:05 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Apply macro only to a range of cells

    Think you can just change this

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    Last edited by nathansav; 07-10-2014 at 11:09 AM.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Apply macro only to a range of cells

    You could keep your sub as it is, but like this

    Please Login or Register  to view this content.

    then call it as normal, but pass the range in ...
    Last edited by nathansav; 07-10-2014 at 11:09 AM.

+ 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] VBA Apply Formula to All Cells In Range
    By hobbiton73 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-20-2014, 09:25 AM
  2. [SOLVED] Can someone help me apply this if statement to a range of cells
    By mk3ll00 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-31-2013, 01:27 PM
  3. Replies: 1
    Last Post: 01-23-2013, 03:00 PM
  4. Replies: 3
    Last Post: 09-13-2012, 03:25 AM
  5. Apply $ to range of cells
    By FM1 in forum Excel General
    Replies: 2
    Last Post: 01-22-2010, 07:56 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