laurie9300
New Member
- Joined
- Jan 30, 2017
- Messages
- 9
I've been a VBA hack for a few years now, and have always managed find and modify code as needed, and learn a little along the way, until now.
I'm doing a large amount of processing over 2 worksheets, and this last step has me confuddled. I have found some code that does each step, but cannot seem to marry them all together.
This processing needs to be done on "Sheet1"
There are 2 values involved and I need to step through all rows:
Date values in Column J
Labour minutes (integer) in Column Q
Each row needs to represent 1 workday of 426 minutes, but some jobs have more than 426 minutes allocated. I need to find and duplicate these rows modifying the labour minutes and date as I go.
If the value in Column Q < 426 - do nothing
If the value in Column Q > 426 - copy the row and paste it underneath - subtract 426 from the original row - in the new row Q = 426 and subtract 1 workday from J in the new row
Before:
![](/board/proxy.php?image=http%3A%2F%2Fi1095.photobucket.com%2Falbums%2Fi472%2Flaurie9300%2FForum%2520Pics%2Fexcel1.jpg&hash=8e7cbcaf8132536ff8d95616e51af9e7)
After:
![](/board/proxy.php?image=http%3A%2F%2Fi1095.photobucket.com%2Falbums%2Fi472%2Flaurie9300%2FForum%2520Pics%2Fexcel2.jpg&hash=3965103102a6ad3e2440e028e1f289d1)
Adding new columns for the date or labour is not a problem, nor is the row order as the data is being referenced in another sheet.
Any help will be greatly appreciated..................
I'm doing a large amount of processing over 2 worksheets, and this last step has me confuddled. I have found some code that does each step, but cannot seem to marry them all together.
This processing needs to be done on "Sheet1"
There are 2 values involved and I need to step through all rows:
Date values in Column J
Labour minutes (integer) in Column Q
Each row needs to represent 1 workday of 426 minutes, but some jobs have more than 426 minutes allocated. I need to find and duplicate these rows modifying the labour minutes and date as I go.
If the value in Column Q < 426 - do nothing
If the value in Column Q > 426 - copy the row and paste it underneath - subtract 426 from the original row - in the new row Q = 426 and subtract 1 workday from J in the new row
Before:
![](/board/proxy.php?image=http%3A%2F%2Fi1095.photobucket.com%2Falbums%2Fi472%2Flaurie9300%2FForum%2520Pics%2Fexcel1.jpg&hash=8e7cbcaf8132536ff8d95616e51af9e7)
After:
![](/board/proxy.php?image=http%3A%2F%2Fi1095.photobucket.com%2Falbums%2Fi472%2Flaurie9300%2FForum%2520Pics%2Fexcel2.jpg&hash=3965103102a6ad3e2440e028e1f289d1)
Adding new columns for the date or labour is not a problem, nor is the row order as the data is being referenced in another sheet.
Any help will be greatly appreciated..................