Hi all,
I am trying to copy data (with determinate columns and indeterminate rows) from 3 sheets on the same worksheet onto an email.
The issue I am having is the declaration of range for the 3 separate sheets, sheet A will always have columns A1 to J1, sheet C and sheet R will always have columns A1 to I1, whereas for all 3 sheets the rows may vary on a daily basis - please refer to the below for a snippet of the code:
For the above:
Thanks
I am trying to copy data (with determinate columns and indeterminate rows) from 3 sheets on the same worksheet onto an email.
The issue I am having is the declaration of range for the 3 separate sheets, sheet A will always have columns A1 to J1, sheet C and sheet R will always have columns A1 to I1, whereas for all 3 sheets the rows may vary on a daily basis - please refer to the below for a snippet of the code:
Dim arng As Range
Dim crng As Range
Dim rrng As Range
Set arng = Worksheets("A").Range("$A$1:$J$1" & Cells(Rows.Count, "A").End(xlUp).Row)
Set crng = Worksheets("C").Range("$A$1:$I$1" & Cells(Rows.Count, "A").End(xlUp).Row)
Set rrng = Worksheets("R").Range("$A$1:$I$1" & Cells(Rows.Count, "A").End(xlUp).Row)
For the above:
- Inclusive of the header on the top row; Sheet A has data from A1 to J6, however it copies the table from A1 to J12
- Inclusive of the header on the top row; Sheet C has data from A1 to I2, however it copies the table from A1 to I12
- Inclusive of the header on the top row; Sheet R has data from A1 to I16, however it copies the table from A1 to I13
Thanks