RobbieC
Active Member
- Joined
- Dec 14, 2016
- Messages
- 376
- Office Version
- 2010
- Platform
- Windows
Hi there, I have a sheet which is full of data. Within the sheet, there is a particular range with data (D10:J29) - 20 rows
There are 10 records in this range, 2 rows for each record. These records are entered via a userform and should start at D10 and then the second record would be recorded at D12 etc.
However, sometimes the records are not entered in order, ie a user might add a record in D14 after D10 therefore leaving a blank row (double row) at D12
What I'm looking to do (via VBA) is to scan through the range and replace any blank row(s) with the next record (if there is one). There is data stored beneath this range, so it's not just a case of 'remove blank rows' as this will affect the data beneath. I think it's a case of 'swapping' the rows of data rather than 'deleting'...
I started to write a subroutine, but it started to become mechanical and overly complicated. I thought there must be a cleverer way to go about it....
I have uploaded an example 'data' sheet to my server which can be found here: https://bluecustard.co.uk/exampleData.xlsm
If you can point me in the right direction, I'd be very grateful. My head is spinning
Cheers. Rob
There are 10 records in this range, 2 rows for each record. These records are entered via a userform and should start at D10 and then the second record would be recorded at D12 etc.
However, sometimes the records are not entered in order, ie a user might add a record in D14 after D10 therefore leaving a blank row (double row) at D12
What I'm looking to do (via VBA) is to scan through the range and replace any blank row(s) with the next record (if there is one). There is data stored beneath this range, so it's not just a case of 'remove blank rows' as this will affect the data beneath. I think it's a case of 'swapping' the rows of data rather than 'deleting'...
I started to write a subroutine, but it started to become mechanical and overly complicated. I thought there must be a cleverer way to go about it....
I have uploaded an example 'data' sheet to my server which can be found here: https://bluecustard.co.uk/exampleData.xlsm
If you can point me in the right direction, I'd be very grateful. My head is spinning
Cheers. Rob