+ Reply to Thread
Results 1 to 12 of 12

Add Weekdays, in column A and some format - required a vba

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

    Add Weekdays, in column A and some format - required a vba

    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, you can check sheet2

    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
    Last edited by Ajay45822; 01-19-2021 at 01:45 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Add Weekdays, in column A and some format

    Without a macro, although if you wanted a macro I'd simply perform these steps with a macro

    1. Add a new column A and in A2 enter
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and copy this down
    2. Add the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    , i.e. the first Thursday to the next blank cell in column D
    3. Add the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    , i.e. where D32 is the cell containing the formula above. Copy this down
    4. Copy this down for n / 5 rows where n is the number of rows in the data
    5. Now sort the data on column D ascending
    6. Autofilter for blanks in column C, then select all the visible dates in column D that you've added and delete them and remove the autofilter
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

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

    Re: Add Weekdays, in column A and some format

    thanks Richard Buttrey for the help,

    thank you very much Richard Buttrey

    can we do it through vba, pls

    vba added in subject.
    Last edited by Ajay45822; 01-19-2021 at 02:09 PM.

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

    Re: Add Weekdays, in column A and some format - required a vba

    Hi to all.
    Ok, lets follow-up. This version of my macro may need some more testing but with the example file is working.
    Please Login or Register  to view this content.
    Last edited by rollis13; 01-19-2021 at 04:57 PM.

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

    Re: Add Weekdays, in column A and some format - required a vba

    Thanks rollis13

    its done now perfectly..

    thank you very much.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Add Weekdays, in column A and some format

    Hi,

    Here's a macro that automates the process I described. Make sure you run it when the data sheet is the active sheet.

    Please Login or Register  to view this content.

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

    Re: Add Weekdays, in column A and some format - required a vba

    thanks Richard Buttrey

    thanks for the macro code,

    form your answer we have also learned some pionts

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

    Re: Add Weekdays, in column A and some format - required a vba

    Glad we've been of some help .

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

    Re: Add Weekdays, in column A and some format - required a vba

    Hi rollis13,

    In the above code (#4),
    your code start the row 1, if we required to run your code from row 2 or row3, then what changes required,

    can you advice pls

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

    Re: Add Weekdays, in column A and some format - required a vba

    Ok, let's make the macro partially dynamic, all you have to do is set the new variable dsr as needed.
    I have marked the consequent changes in the code.
    Please Login or Register  to view this content.
    Last edited by rollis13; 02-08-2021 at 10:55 AM.

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

    Re: Add Weekdays, in column A and some format - required a vba

    o.k.

    thanks rollis13

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

    Re: Add Weekdays, in column A and some format - required a vba

    Glad having been of some other help.

+ 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] Add Weekdays, in column A and after every Thursday add a blank row
    By Ajay45822 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-19-2021, 01:03 PM
  2. [SOLVED] Plot week as a column in between Weekdays
    By Parth007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-11-2020, 06:22 PM
  3. [SOLVED] Column that enumerates weekdays
    By diegoxe18 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-23-2019, 05:18 PM
  4. [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
  5. 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
  6. format weekdays
    By ammartino44 in forum Excel General
    Replies: 1
    Last Post: 03-03-2014, 02:19 PM
  7. [SOLVED] Dates wont format to weekdays
    By georgeparker88 in forum Excel General
    Replies: 3
    Last Post: 08-06-2012, 09:10 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