+ Reply to Thread
Results 1 to 3 of 3

Every 16th-30th or 16th-31st of the month, value from 1st sheet will go to 2nd sheet | VBA

  1. #1
    Registered User
    Join Date
    03-24-2013
    Location
    Quezon City, Philippines
    MS-Off Ver
    Excel 2010/2013
    Posts
    83

    Every 16th-30th or 16th-31st of the month, value from 1st sheet will go to 2nd sheet | VBA

    Hi friends,

    I have a column A and B in Sheet2 in which it is labeled as Pay period from and Pay period to, respectively.

    What I'd like to happen is that when the user chooses every 16th-30th of the month or 16th - 31st of the month, let's say column M in Sheet1 which is labeled as Allowance will go to the column N labeled as Allowance as well in Sheet2. However if the user chooses every 1st-15th of the month, the allowance will not reflect in Sheet2 in column Allowance.

    For example:
    Sheet1
    Column M
    Allowance: 1,000

    Sheet2
    1st scenario

    Column A
    Column B
    Pay Period From:
    Pay Period To:
    November 1,2015
    November 15,2015
    >>1,000 in Column M in Sheet1 will not be seen in Column N of Sheet2 as the user chose November 1, 2015 - November 15, 2015.

    2nd scenario

    Column A
    Column B
    Pay Period From:
    Pay Period To:
    December 1, 2015
    December 15, 2015
    >>1,000 in Column M in Sheet1 will not be seen in Column N of Sheet2 as the user chose December 1, 2015 - December 15, 2015.


    However, if the user chooses:

    Sheet2
    1st scenario
    Column A
    Column B
    Pay Period From:
    Pay Period To:
    November 16, 2015
    November 30, 2015
    >>1,000 in Column M in Sheet1 will appear in Column N of Sheet2 as the user chose November 16, 2015 - November 30, 2015.

    2nd scenario

    Column A
    Column B
    Pay Period From:
    Pay Period To:
    December 16, 2015
    December 31, 2015
    >>1,000 in Column M in Sheet1 will not be seen in Column N of Sheet2 as the user chose December 16, 2015 - December 31, 2015.

    I'd like to code this in VBA.

    Thank you so much for your help!

  2. #2
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: Every 16th-30th or 16th-31st of the month, value from 1st sheet will go to 2nd sheet |

    2nd scenario

    Column A
    Column B
    Pay Period From:
    Pay Period To:
    December 16, 2015
    December 31, 2015
    >>1,000 in Column M in Sheet1 will not be seen in Column N of Sheet2 as the user chose December 16, 2015 - December 31, 2015.
    Trying to understand your request, the second 2nd scenario breakes your rule.....
    Is it a mistake or is there a hidden rule that I can't see?
    Barriers are there for those who don't want to dream

  3. #3
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: Every 16th-30th or 16th-31st of the month, value from 1st sheet will go to 2nd sheet |

    Assuming that you have defined the row on which you do the job (Ex.Row4)
    use a code like this:

    Please Login or Register  to view this content.
    But the same can be done with a simple formula placed directly on cell N4:

    Please Login or Register  to view this content.

+ 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: 4
    Last Post: 12-28-2023, 01:18 PM
  2. [SOLVED] Check if its the 16th day of month
    By Hesher in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-18-2013, 12:36 AM
  3. formula to return either 1st or 16th of month
    By humboldtguy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-29-2010, 02:58 PM
  4. Replies: 2
    Last Post: 09-06-2005, 03:05 AM
  5. Replies: 2
    Last Post: 09-06-2005, 02:05 AM
  6. Replies: 2
    Last Post: 09-06-2005, 01:05 AM
  7. Replies: 2
    Last Post: 09-06-2005, 12:05 AM
  8. Replies: 2
    Last Post: 06-02-2005, 04:05 AM

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