+ Reply to Thread
Results 1 to 7 of 7

Macro to conditionally insert and alter rows

  1. #1
    Registered User
    Join Date
    07-08-2022
    Location
    Birmingham, Alabama
    MS-Off Ver
    365 for Enterprise
    Posts
    4

    Macro to conditionally insert and alter rows

    Good morning,
    I'm looking to break time records into 30 minute buckets. Example: 8:00a - 9:00a 60 min should become two rows: 8:00a-8:30a 30 min and 8:30a-9:00a 30 minute. I'll then make a pivot to summarize the buckets. If a row has a 30 minute record, leave it. If it is 60 minutes, break into two 30 minute records. If it is 90, break into three 30 minute records, and so on. Any help is appreciated.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Macro to conditionally insert and alter rows

    Here's a solid start. I'm leaving the office for the weekend and will finish the code once I get back, or if someone else wants to hop in that would be great.

    Best,
    Carlmon

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-08-2022
    Location
    Birmingham, Alabama
    MS-Off Ver
    365 for Enterprise
    Posts
    4

    Re: Macro to conditionally insert and alter rows

    Thanks Carlmon. I'm new to macro development and will try and step through it. Additional insight is appreciated.
    Jordan

  4. #4
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Macro to conditionally insert and alter rows

    I made progress on this one (below). I'll leave you with the fun task of finishing the 120 minutes and adjusting the start times. If you get stumped, I'll finish it for you.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-08-2022
    Location
    Birmingham, Alabama
    MS-Off Ver
    365 for Enterprise
    Posts
    4

    Re: Macro to conditionally insert and alter rows

    Thanks, again, Carlmon. I ran it and it is certainly a good start - I'll see if I can step through the code and fill in the gaps.

  6. #6
    Registered User
    Join Date
    07-08-2022
    Location
    Birmingham, Alabama
    MS-Off Ver
    365 for Enterprise
    Posts
    4

    Re: Macro to conditionally insert and alter rows

    Carlmon, I was able to finish the buildout and get it running. Thank you!!

  7. #7
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Macro to conditionally insert and alter rows

    That's awesome! I'm glad you were able to follow along

+ 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. Need help on a macro that will insert blank rows conditionally
    By programmernewbie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-16-2015, 02:45 PM
  2. How would you alter the data range of a chart conditionally?
    By unnobtanium in forum Excel General
    Replies: 5
    Last Post: 12-10-2014, 02:50 PM
  3. Simple macro to conditionally insert a row?
    By Cam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-13-2014, 03:47 PM
  4. Macro to insert rows conditionally.
    By HarryC23 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-10-2014, 06:36 AM
  5. Insert Rows Conditionally
    By samsonuk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2013, 07:06 PM
  6. [SOLVED] Macro to conditionally insert rows and fill them
    By dproth in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2013, 09:48 AM
  7. Conditionally insert rows, sum and average
    By menyanthe in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-10-2009, 04:54 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