+ Reply to Thread
Results 1 to 5 of 5

Code to surround the date with brackets

  1. #1
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Code to surround the date with brackets

    Dear Friends,
    I need a code to surround a date in column ‘ad’ date of expire after next day automatically to prevent send mail next year in a macro ‘anniversary4’ only. Do suggest me a code to perform this action automatically. Please see the sample in cell ‘ad9’. In short if the expired date is 07/09/2013 then it should be change as (07/09/2013) on next day 08/09/2013 automatically.

    Thanking you in anticipation.

    Mukesh
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Code to surround the date with brackets

    Hi,

    Can you try this code :

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Re: Code to surround the date with brackets

    Hi GC excel,
    Thank you. I'm getting error 'sub or function not defined'. Please check it and remove error. The cell range is 'ad9' Do check it.
    I changed the date in cell 'b4' for testing but in vain.

    Thank you.

    Mukesh
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Code to surround the date with brackets

    You put the macro in an other module ... so change this line :

    Please Login or Register  to view this content.
    to this

    Please Login or Register  to view this content.
    and try again.

  5. #5
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Re: Code to surround the date with brackets

    Ok! I tried it but the date is not surrounded with brackets. So I put the code in this workbook module but no result. Only the error is gone.

    I first run the anniversary4 macro then changed the date in cell b4 to 08/09/2013 and run the anniversary4 macro. The message is sent againn instead surrounding the date with brackets.

    Please let me know how to check it.

    Thank you for guidance.

    Mukesh
    Attached Files Attached Files

+ 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: Read date and paste the date info on the correct cell. Analyse code please.
    By ropbasuel in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-10-2013, 05:32 AM
  2. Formulating Date cells to auto color code based on Date
    By darren.capps in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-23-2013, 02:08 PM
  3. Color Code Actual Date versus Due Date ( Red, Yellow, Green )
    By Bfisher74 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-28-2013, 10:10 AM
  4. Replies: 5
    Last Post: 04-19-2012, 09:02 AM
  5. What the code in the brackets mean
    By excelkeechak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2009, 07:50 AM

Tags for this Thread

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