SandyBeach
New Member
- Joined
- Apr 22, 2021
- Messages
- 11
- Office Version
- 365
- Platform
- Windows
I have a range which contains individual cell formatting which makes up specific designs. The range is quite large - 500 columns x 300 rows - and is trimmed as required by a VBA routine in order for the design to fit specific dimensions. Trimming is not just by cutting off the surplus right hand columns or bottom rows as the trimming modifies both the size and elements of the design. So, trimming may be effected by cutting off both left and right hand columns, or just the left hand columns, or just the top rows, etc. That is stage 1 and it works well.
Stage 2 requires the trimmed design/range - for which I know the exact number of columns and rows (which could be 500 x 300 but is generally not) - to be copied to another range of exactly the same size and which contains other design elements. Given the design is all formats I want to be able to look at each destination cell to determine if it is occupied (probably by an integer) before copying and pasting from the original range. So, the routine needs to look at, say, the top left hand cell of the destination range and identify if it it is vacant or filled before copying the format in the top left cell of the source range. If the destination cell is vacant, the contents are copied and pasted. If the destination cell is occupied, the routine moves on without copying and pasting.
I have fiddled about with some code but it is so bad i am not going to present it here!
All suggestions gratefully received.
Stage 2 requires the trimmed design/range - for which I know the exact number of columns and rows (which could be 500 x 300 but is generally not) - to be copied to another range of exactly the same size and which contains other design elements. Given the design is all formats I want to be able to look at each destination cell to determine if it is occupied (probably by an integer) before copying and pasting from the original range. So, the routine needs to look at, say, the top left hand cell of the destination range and identify if it it is vacant or filled before copying the format in the top left cell of the source range. If the destination cell is vacant, the contents are copied and pasted. If the destination cell is occupied, the routine moves on without copying and pasting.
I have fiddled about with some code but it is so bad i am not going to present it here!
All suggestions gratefully received.