I have a dynamic range `rng2` that goes from `A4:F?`. I tried adapting code from this site, but keep getting errors when I try to sort it. `Officers` is a string `"E1:E" & last row`. `Tgroup` is a string `"D1:D" & last row`.

```
rng2.Sort key1:=Range(officers), Order1:=xlAscending, _
key2:=Range(tgroup), order2:=x1Ascending, Header:=x1No

```

---

From comments:

`i` is a counter used earlier & is 1 row below the last row.

```
Dim officers As String, tgroup As String, sArea As String, rng2 As Range
officers = "E1:E" & (i - 4)
tgroup = "D1:D" & (i - 4)
sArea = "A4:F" & (i - 1)
Set rng2 = rng.Range(sArea)
rng2.Sort key1:=Range(officers), Order1:=xlAscending, _ 
          key2:=Range(tgroup), order2:=xlAscending, Header:=xlNo

```

`rng` is a range from `A1:F?` but has merged cells which is why I have `rng2`.