+ Reply to Thread
Results 1 to 4 of 4

Based on col dates create col of dates for the first day of that same month and year

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Based on col dates create col of dates for the first day of that same month and year

    I have a column of dates say in col B. In col-A i want the following:

    ColA ** ColB
    1/1/11 ** 1/14/11
    1/1/11 ** 1/28/11
    2/1/11 ** 2/4/11
    1/1/11 ** 1/12/11
    3/1/11 ** 3/14/11


    Basically, i have a col dates in B.....i want the first day of that month/year in col-A.

    I am enclosing a file showing what i want. I can do it in excel but not sure how to "efficiently" do it in vba.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    06-07-2011
    Location
    Hnd
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: Based on col dates create col of dates for the first day of that same month and y

    Hi welchs101,

    I'm not sure if I undestand, but try this:

    In A2 put "=DAY(B2)" --> this will give you the day of the date you have in B2

    or

    In A2 put "=B2-DAY(B2)+1" --> this will give you the first day of that month you have in B2.

    Copy down any of the formulas if works for you.

    Hope this helps,

    Regards.

  3. #3
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: Based on col dates create col of dates for the first day of that same month and y

    thanks. i will try that. do you know if this is also available via vba code?

    thanks.

  4. #4
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Based on col dates create col of dates for the first day of that same month and y

    Hello,

    I am an absolutely newbie in VBA. I don't know if this fix your problem. Anyway try this in a Copy of your workbook

    Please Login or Register  to view this content.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

+ 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