+ Reply to Thread
Results 1 to 6 of 6

Getting code to cycle over itself and ignore blank cells

  1. #1
    Forum Contributor
    Join Date
    05-27-2014
    Posts
    141

    Getting code to cycle over itself and ignore blank cells

    Hi Experts, I previously posted this code but was way off base with it so with helpful advice from another member i was able to clean up the code but i am still struggling to get to the end result.

    What I am trying to do is get the code below in section 1 to cycle through a range so that it copies the first cell in the range, creates the three pdf's then goes back to the 2nd cell and repeats until it has completed the range and ignores errors or blank cells withing the range and then ends on section 2.

    Please Login or Register  to view this content.
    I have a similar code that emails out from a range but i can not seem to manipulate the code to fit new requirements

    Please Login or Register  to view this content.
    Any input that might help in right direction would be great

    Thanks In advance

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Getting code to cycle over itself and ignore blank cells

    1) Declare a range variable
    2) use that variable to cycle through your known range
    3) Before executing the code for each cell, test the value

    Something like this maybe;

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    05-27-2014
    Posts
    141

    Re: Getting code to cycle over itself and ignore blank cells

    Wow just wow, thank you - i had to modify my sheet slightly but it worked thank you so much

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Getting code to cycle over itself and ignore blank cells

    Glad to help. I wanted to point out that recorded macros always show the "selecting" and "activating" because it is recording your human actions. You should strive to remove that as you finalize your code. VBA does not usually need to activate/select sheets/cells before acting on them, you can send your commands directly to those sheets/cells by simply properly addressing them fully in the command.


    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  5. #5
    Forum Contributor
    Join Date
    05-27-2014
    Posts
    141

    Re: Getting code to cycle over itself and ignore blank cells

    Thats roughly what I am seeing now as I start to move all the coded button to one sheet the codes stop working and its due to your last comments, so thank you you solved two issues in one thread, how would you suggest the best method of learning code is?

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Getting code to cycle over itself and ignore blank cells

    Heh, one real issue at a time.

+ 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. Ignore blank cells
    By ACrossley1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-08-2014, 01:44 PM
  2. [SOLVED] Ignore blank cells
    By Zagra147 in forum Excel General
    Replies: 18
    Last Post: 03-01-2014, 03:32 PM
  3. Ignore blank cells and truly blank cells in named range?
    By hschillig in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-13-2014, 02:56 PM
  4. Replies: 5
    Last Post: 05-18-2013, 07:49 PM
  5. How can I make a macro ignore blank cells? - Blank Cells have formulas
    By mz1161 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-30-2013, 08:54 AM
  6. How To ignore blank cells....
    By gtdi-95 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-15-2008, 06:03 AM
  7. How to ignore blank cells
    By MattBeckwith in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 02-19-2006, 07:25 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