+ Reply to Thread
Results 1 to 7 of 7

Update date column with number of days in another column using vba

  1. #1
    Registered User
    Join Date
    02-26-2010
    Location
    Delhi, India
    MS-Off Ver
    Excel 2013
    Posts
    74

    Red face Update date column with number of days in another column using vba

    Hello all
    i have a table with 10 columns and last four are date columns i.e. G H I & J.
    Last three have formula
    column B require input from user for in number and column G require date.
    Column H is simple addition of Column B & G
    for example if B has value 5 and G has 1 Apr 17 then H will be 6 Apr 17. this is easy with formula but i want to achieve this with vba.
    can anyone help please.
    Thanks

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Update date column with number of days in another column using vba

    May be
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Registered User
    Join Date
    02-26-2010
    Location
    Delhi, India
    MS-Off Ver
    Excel 2013
    Posts
    74

    Re: Update date column with number of days in another column using vba

    hi Yasser thanks it gives result as required, but code is stuck in loop.. something to come out of loop..

    thanks again

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Update date column with number of days in another column using vba

    Have a look at this code may be a guidance for you
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-26-2010
    Location
    Delhi, India
    MS-Off Ver
    Excel 2013
    Posts
    74

    Re: Update date column with number of days in another column using vba

    hi Yasser i got it right with selection change event. i am attaching the file with formulas but i want to achieve this with vba. help is appreciated.
    heading are
    (to be entered by user)
    B = Number of days (has to be number)
    C = PF means Prefix
    D = IF i.e. Interfix
    E = SF i.e. Suffix
    F = JP i.e. journey period
    G = Departure date
    calculated fields
    H = Start Date i.e. H + C
    I = End Date i.e. B+D+E+F
    J = Reporting Date i.e. if F is empty(no JP) then I + 1 else I
    thanks again

  6. #6
    Registered User
    Join Date
    02-26-2010
    Location
    Delhi, India
    MS-Off Ver
    Excel 2013
    Posts
    74

    Re: Update date column with number of days in another column using vba

    the file could not attach earlier.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-26-2010
    Location
    Delhi, India
    MS-Off Ver
    Excel 2013
    Posts
    74

    Re: Update date column with number of days in another column using vba

    one more problem, the code is working fine in first row but doesnt work in following rows.
    i modified the code to add I column also.

    Thanks
    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. Replies: 10
    Last Post: 01-03-2021, 06:24 PM
  2. [SOLVED] Count number of days in column without an end date?????????
    By EmDubeu in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-19-2016, 04:41 PM
  3. Replies: 3
    Last Post: 04-08-2016, 09:11 AM
  4. Add Date in Column A Plus Number of Days in Column B and show result in Column C
    By excelforumcrisis in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-12-2013, 02:01 PM
  5. [SOLVED] Macro to update the date column for certain rows in a table depending on a column value
    By ajolin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-18-2012, 12:21 AM
  6. [SOLVED] Search 1st Column for Date older than 5 days based on 2nd column contents
    By Nu2Java in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-31-2012, 10:49 PM
  7. Replies: 3
    Last Post: 08-22-2006, 04:20 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