Hi there,
I have a table and, using union command, I select some columns.
Code
Set lo = .ListObjects(1)
lo.Name = "TabClas"
Set a = Range("TabClas[[" & cPett & "]:[" & cRuo & "]]")
Set a = a.Offset(-1).Resize(a.Rows.Count + 1)
Set b = Range("TabClas[[" & frmPremiSpeciali.cmbVCT1.value & "]]")
Set b = b.Offset(-1).Resize(b.Rows.Count + 1)
Set c = Range("TabClas[[" & frmPremiSpeciali.cmbVCT2.value & "]]")
Set c = c.Offset(-1).Resize(c.Rows.Count + 1)
Set d = Range("TabClas[[" & frmPremiSpeciali.cmbVCT3.value & "]]")
Set d = d.Offset(-1).Resize(d.Rows.Count + 1)
Set e = Range("TabClas[[p." & frmPremiSpeciali.cmbVCT1.value & "]]")
Set e = e.Offset(-1).Resize(e.Rows.Count + 1)
Set f = Range("TabClas[[p." & frmPremiSpeciali.cmbVCT2.value & "]]")
Set f = f.Offset(-1).Resize(f.Rows.Count + 1)
Set g = Range("TabClas[[p." & frmPremiSpeciali.cmbVCT3.value & "]]")
Set g = g.Offset(-1).Resize(g.Rows.Count + 1)
Set h = Range("TabClas[[PEN.]]")
Set h = h.Offset(-1).Resize(h.Rows.Count + 1)
Set i = Range("TabClas[[TOT]]")
Set i = i.Offset(-1).Resize(i.Rows.Count + 1)
Union(a, b, c, d, e, f, g, h, i).Select
Display More
My issue is that I need to delete the columns on table which are not selected.
Due to there're some formulas on table, I need this because I need to keep the formulas valid, just recalculate with selected columns.
it's also OK for my purpose, just clear the content if it's easier.
any suggestion?