seniorjerry
New Member
- Joined
- Jan 20, 2023
- Messages
- 9
- Office Version
- 365
- Platform
- Windows
Hey I'm writing a VBA function to generate a couple reports in a consistent printable format. Everything is working fine thus far except that variable functions I am inputting into a cell are adding an @ symbol and breaking the function making it have to be manually fixed. Is their a way to make it stop including these @ symbols?
I cut out the part of the code that matters and put it here. This keeps resulting in
instead of
VBA Code:
For L2 = 2 To 12
CellChar = Switch(L2 = 2, "B", L2 = 3, "C", L2 = 4, "D", L2 = 5, "E", L2 = 6, "F", L2 = 7, "G", L2 = 8, "H", L2 = 9, "I", L2 = 10, "J", L2 = 11, "K", L2 = 12, "L")
CellChar2 = Switch(L2 = 2, "C", L2 = 3, "D", L2 = 4, "E", L2 = 5, "F", L2 = 6, "G", L2 = 7, "H", L2 = 8, "I", L2 = 9, "J", L2 = 10, "K", L2 = 11, "L", L2 = 12, "M")
Sheets("VLF").Cells(XLoc + 3, L2 + 1) = "=COUNTIFS(Rent_Roll[UnitType],$" & CellChar & XLoc + 3 & "#,Rent_Roll[LeaseTo],"" >= ""&" & CellChar2 & "$" & XLoc + 1 & ",Rent_Roll[LeaseTo],"" <= ""&" & CellChar2 & "$" & XLoc + 2 & ")"
Next L2
I cut out the part of the code that matters and put it here. This keeps resulting in
Excel Formula:
=@SORT(UNIQUE(Rent_Roll[UnitType]))
Excel Formula:
=SORT(UNIQUE(Rent_Roll[UnitType]))