Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

586
Visualizações
Is it possible to refer a whole column of another sheet in .formular1c1?

I have this question based on a question asked in this link

For example, the formula in cell C1 Sheet1 is =VLOOKUP(A1,Sheet2!A:B,2,FALSE)

The code I've tried which work is only the "test-5"

Sub test()

'test-1
Range("C1").FormulaR1C1 = "=VLOOKUP(rc[-2],'" & Sheet2.Name & "'!c[1]:c[2],2,false)"
'=VLOOKUP(A1,Sheet2!D:E,2,FALSE) ---> wrong formula

'test-2
Range("C1").FormulaR1C1 = "=VLOOKUP(rc[-2],'" & Sheet2.Name & "'!A:B,2,false)"
'=VLOOKUP(A1,Sheet2!A:(B),2,FALSE) ---> wrong formula

'test-3
Range("C1").FormulaR1C1 = "=VLOOKUP(rc[-2],'" & Sheet2.Name & "'!$A:$B,2,false)"
'throw error 1004

'test-4
Range("C1").FormulaR1C1 = "=VLOOKUP(rc[-2],'" & Sheet2.Name & "'!r[1]c[1]:r[100]c[2],2,false)"
'=VLOOKUP(A1,Sheet2!D2:E101,2,FALSE) ---> wrong formula

'test-5
Range("C1").FormulaR1C1 = "=VLOOKUP(rc[-2],'" & Sheet2.Name & "'!r1c1:r100c2,2,false)"
'=VLOOKUP(A1,Sheet2!$A$1:$B$100,2,FALSE) ---> formula work but the range is with a defined row number

End Sub

So if the answer is :
it's not possible, then I'd be glad if there is an explanation about this.
it's possible, then how ?

I also curious in test4 vs test5.
If in test5, r1c1:r100c2 gives a correct range $A$1:$B$100 with $ sign
Why in test4, r[1]c[1]:r[100]c[2] don't give A1:B100 without $ sign,
but still refer the cell as if it offsetting based on cell C1 Sheet1 (D2:E101)?

Any kind of help would be greatly appreciated.
Thank you in advanced.

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda