Set xlbook = GetObject("C:\07509\LB_RACKTMC.xlsx")
Set xlSheet = xlbook.Sheets("LB RACK")
Set src = xlSheet.Range("f1..f3").CurrentRegion.SpecialCells(xlCellTypeVisible)
Set sh = xlbook.Sheets.Add
src.Copy sh.Range("a1")
m = sh.Range("a1").CurrentRegion
For ro = LBound(m) + 1 To UBound(m)
Debug.Print LBound(m), UBound(m)
I want to copy a range "f1 to f3" from sheet "LB RACK" to a new sheet ("Sheet1")
For some reason, the Ubound(m) value in this VBA code is showing as 1245. Should this not be 3, as the range I am copying is ("f1..f3")?
Set xlSheet = xlbook.Sheets("LB RACK")
Set src = xlSheet.Range("f1..f3").CurrentRegion.SpecialCells(xlCellTypeVisible)
Set sh = xlbook.Sheets.Add
src.Copy sh.Range("a1")
m = sh.Range("a1").CurrentRegion
For ro = LBound(m) + 1 To UBound(m)
Debug.Print LBound(m), UBound(m)
I want to copy a range "f1 to f3" from sheet "LB RACK" to a new sheet ("Sheet1")
For some reason, the Ubound(m) value in this VBA code is showing as 1245. Should this not be 3, as the range I am copying is ("f1..f3")?