L
Legacy 108787
Guest
In a large sheet I have several pivottables, using a dynamic range of sourcedata. I want one empty column between two tables.
Due to the dynamic range and some conditions for (self genererated) tabletitles, the cell for the next table to start can be different every time around. I therefore have to check which of two rows is longest, to have the next table exactly two cells further, leaving one blank column.
I have the following code:
This obviously doesn't work as One and Two are non-comparable, Row-wise.
I tried adding .Row, or [R], Address... but I'm stuck. I can't find anthing on here nor on Google.
Due to the dynamic range and some conditions for (self genererated) tabletitles, the cell for the next table to start can be different every time around. I therefore have to check which of two rows is longest, to have the next table exactly two cells further, leaving one blank column.
I have the following code:
Code:
Sub Last_Cell()
Dim One As Range 'title (string) row
Dim Two As Range 'content of table row
Dim Fin As Range
Set One = Range("IV5").End(xlToLeft).Offset(0, 2)
Set Two = Range("IV11").End(xlToLeft).Offset(0, 2)
If One > Two Then
Set Fin = One
Else
Set Fin = Two
End If
Fin.Select
End Sub
I tried adding .Row, or [R], Address... but I'm stuck. I can't find anthing on here nor on Google.