0

I feel like I'm missing something basic, but I have the following bit of code that is referring to a table on another sheet.

Sub availabilityTab()
Dim cell As String
Dim i As Integer

With Sheets("Availability")
.Cells.Clear
.Range("A3") = "=BackgroundData[#Headers]"

    For i = 1 To 5
    cell = .Cells(3, i)
    .Cells(4, i) = "=BackgroundData[" & cell & "]"
    Next i


End With
End Sub

Unfortunately, when it inserts the formula in these cells it inserts an "@" that keeps the result from spilling, such as

=@BackgroundData[#Headers]

in A3. Or

=BackgroundData[@ID]

in A4. How do I keep it from inserting the @? Thanks!

sriche01
  • 33
  • 7
  • 1
    `BackgroundData[ID]` without the `@` symbol is a reference to a column, not a cell. Is that what you're trying to get? – jsheeran Dec 12 '22 at 13:45
  • @jsheeran yes I want the column to spill down. Same with the Headers row: I want it to spill. – sriche01 Dec 12 '22 at 13:53

0 Answers0