+ Reply to Thread
Results 1 to 3 of 3

if value exists

  1. #1
    Registered User
    Join Date
    03-14-2007
    Posts
    58

    if value exists

    Have a lot of data organized on worksheet "closed cases". Need the worksheet to be organized by day. Currently am calling the following macro from another macro and then using a delete duplicate rows to get the duplicate dates out but I know there's an easier way to do it code wise. Have over 6000 rows so the duplicate one is not ideal.

    I want the macro to check column B for today's date and if it exists, do nothing, if it does not exist, put today's date under the last row of data.

    Here's what I currently have. I put the paste special in there so that the date doesn't change. I'm not very good at if then statements yet

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    here is one way

    I have replaced the

    Please Login or Register  to view this content.
    Please note that you should avoid using macro & variables names that match commands used by Excel & VBA. e.g. Today, Rows, Sheets etc
    Using such names can cause unexpected results

    For Your Info
    Most times you do not need to select sheets, cells etc to work with them
    Macros actually run faster & can be easier on the eyses if you do not select or activate sheets etc

    The code you posted could be replaced by a single line command

    Please Login or Register  to view this content.
    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.

  3. #3
    Registered User
    Join Date
    03-14-2007
    Posts
    58
    thank you

+ 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