+ Reply to Thread
Results 1 to 16 of 16

Add Weekdays, in column A and after every Thursday add a blank row

  1. #1
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Add Weekdays, in column A and after every Thursday add a blank row

    Hi,

    we have a database where we are trying to add weekdays in column A and after that it will add blank row if its Thursday

    Process is
    1. Add a column A
    2. Start adding weekdays
    3. Add a blank row after every Thursday
    4. We required only following weekdays

    Friday
    Monday
    Tuesday
    Wednesday
    Thursday

    if there is no data in weekday it will be blank row

    we have also attached a demo data sheet with result sheet
    Sheet1 is data sheet and Sheet2 is result sheet

    advice pls
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,705

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    Your first date, 8th April 2021, is actually a Thursday. Do you want your table to start with the earliest date in your data, or should it always start with a Friday?

    Are you looking for a macro to do this?

    Pete

  3. #3
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    917

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    Hi, this is what I came up with; paste the macro in a standard Module. Since you didn't say if you needed to add only a bunch of cells or an entire row, in the macro you can choose whatever.
    Please Login or Register  to view this content.
    Last edited by rollis13; 01-18-2021 at 06:29 PM.

  4. #4
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    Thanks rollis13,

    you have done a great work for me. thank you very much

    can we make the below WEEKDAYS SERIES default, please check sheet2!A2:A6 in thread #1

    Friday
    Monday
    Tuesday
    Wednesday
    Thursday

    if there is no data in a day, that raw will be blank

  5. #5
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    917

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    You haven't replied to @Pete_UK question and I would also point out that 11-apr and 18-apr are Sundays, how are they to be treated.

  6. #6
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    First of all Sorry for not reply @Pete_UK,

    reason, we have got the solution from you and we have another query on this so think give reply after getting from you

    if there is any other day expect
    Friday
    Monday
    Tuesday
    Wednesday
    Thursday

    remove whole row

    we want only data
    Friday
    Monday
    Tuesday
    Wednesday
    Thursday

    rest nothing

    in my data, we have only following day, in demo data, we have entered this wrong and really sorry for that and will take care in future

    in my data there is only following day
    Friday
    Monday
    Tuesday
    Wednesday
    Thursday

    no other day
    Last edited by Ajay45822; 01-18-2021 at 01:25 PM.

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,705

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    I was going to propose a formula-based solution, with the starting point being the earliest date in your data, which I then discovered was a Thursday, so I was asking you if you wanted to start with that, in which case you would have:

    Thursday ... 08-04-21

    Friday ... other dates ...
    Monday
    Tuesday
    Wednesday
    Thursday

    and so on, or did you always want to start with a Friday, in which case you would have:

    Friday
    Monday
    Tuesday
    Wednesday
    Thursday ... 08-04-21

    Friday ... other dates ...
    Monday
    Tuesday
    Wednesday
    Thursday

    However, you seem to want a VBA solution, so I'll duck out of this one.

    Pete

  8. #8
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    Hi Pete_UK

    thanks for your effort and time to give my post

    we have got the vba from rollis13 its working, we just want some modification now

    We have just checked and now know my demo data start with Thursday, no problem after Thursday we will add a blank cell and start the new data from Friday

    if my first filled data start with Wednesday, then it will be Wednesday, Thursday and after giving a blank row my next data will be start from Friday

    If my first filled data start with Tuesday, then it will be Tuesday,Wednesday, Thursday and after giving a blank row my next data will be start from Friday

    If my first filled data start with Monday, then it will be Monday, Tuesday,Wednesday, Thursday and after giving a blank row my next data will be start from Friday

    If my first filled data start with Friday, then it will be Friday, Monday, Tuesday,Wednesday, Thursday after Thursday we will give the blank row

  9. #9
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    917

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    If I correctly understood your further request, have a try with this other versione:
    Please Login or Register  to view this content.
    How about the missing tuesday 13-apr ? do you need to fill in the gap ?
    Last edited by rollis13; 01-18-2021 at 06:28 PM.

  10. #10
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    Thanks rollis13 for the help, its working perfectly

    only one query is left and that is
    in the weekdays serial
    Friday
    Monday
    Tuesday
    Wednesday
    Thursday

    if we have not data in a day then that row will be blank
    as we have done in given sheet2!A2:A6 in thread #1
    you can check in range Sheet2!A5, there is no data but we have that days

    thank you very much for the help, pls check if the above format we can implement ,

    we have created a new sheet with result data and highlighted the cells with blue colour where we have no data and its blank, we required this format, (if you see you can understand my point, its the perfect sheet for me))
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    917

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    Not everything is clear since you didn't answer my question in post #9, therefore, my feedback will be by intuition.
    If you only need a standalone macro to color your no-data rows use this applyed to your lastest file post #10:
    Please Login or Register  to view this content.
    In the meantime I have updated my previous macro post #9 to the new layout and to manage missing dates and also to color no-data rows, have a try:
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    Hi, thanks , checked with the code but there is some problem

    request you to pls check once

    pls

  13. #13
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    i have used the sheet of thread #10

    and below code
    HTML Code: 

  14. #14
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    917

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    No, it isn't supposed to work with the sheet attached to post #10.
    As said, could work only if you delete column A and blank rows (as it was in post #1) and change the reference for the date which was in column D and now in column C.
    When you change layout I suggest you start a new thread to avoid missunderstandings.
    Last edited by rollis13; 01-19-2021 at 12:58 PM.

  15. #15
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    ok, i m going to create a new thread,

    with the fresh sheets to avoid misunderstanding.

    thanks,

    meet you in next post

  16. #16
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Re: Add Weekdays, in column A and after every Thursday add a blank row

    thanks thanks thanks thanks rollis13

    created new thread, marking this thread as solved.

    my new thread is
    https://www.excelforum.com/excel-pro...ml#post5457397

+ 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] Column that enumerates weekdays
    By diegoxe18 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-23-2019, 05:18 PM
  2. [SOLVED] Macro identifying tomorrow column as "today", then filling Thursday's column
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-08-2018, 03:47 PM
  3. [SOLVED] Weekdays in column for current month
    By biznez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2016, 01:59 PM
  4. Fill the next 30 Weekdays in a column
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-02-2014, 10:05 PM
  5. Replies: 1
    Last Post: 07-13-2014, 09:37 AM
  6. Replies: 5
    Last Post: 01-08-2013, 11:38 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