Closed Thread
Results 1 to 3 of 3

Error in macro when no data is available

  1. #1
    Registered User
    Join Date
    07-17-2008
    Location
    Dover
    Posts
    27

    Error in macro when no data is available

    This macro I currenly use takes data from each month of the year so far (data is updated on a daily basis) and manipulates it on a different sheet. I have writen the macro for the entire year, but since there is no data yet for October, I get an error when it tries to take that data out. The error occurs on the Columns("C:C").SpecialCells line. There, I have selected the Go To option, then special, then selected formulas and text. Is there any way that I could write some code so that if there is no data to select, it stops or goes on to do something else? I have looked into loops, but am not sure it would be best for this situation as there is much more to this code than shown. I hope I have done a decent job explaining my situation, as I am still slowly learning how to write macros. Any help would be greatly appreciated. Thanks.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe something like

    Not fully tested

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Closing thread as PChav has posted a new thread with a better discription of his/her problem
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to grab external data and paste values into a master spreadsheet
    By Lotus123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-16-2009, 03:11 PM
  2. Macro for Multiple Charts from table (sequential data ranges)
    By kostas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-31-2008, 09:13 AM
  3. Pause In Mid Macro To Modify Data
    By nebb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2007, 10:34 PM
  4. macro for multiple tabs from a data set
    By Brigitte in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-15-2007, 07:17 PM
  5. Macro to format large data set
    By claytorm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2006, 01:08 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