Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Absolute Reference

  Asked By: Fujita    Date: Nov 05    Category: MS Office    Views: 660
  

Could somebody explain how to change relative reference to absolute. Below is
a macro recorded today. I would like to see the reference as B8 or C9 etc
rather than R1C1


Sub Macro2()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+l
'
Range("B2:E2").Select
ActiveCell.FormulaR1C1 = "='MAIN PAGE'!R[8]C2"
Range("B3:E3").Select
ActiveCell.FormulaR1C1 = "='MAIN PAGE'!R[7]C3"
Range("B4:E4").Select
ActiveCell.FormulaR1C1 = "='MAIN PAGE'!R[6]C4"
Range("I2:K2").Select
ActiveCell.FormulaR1C1 = "='MAIN PAGE'!R[8]C6"
Range("O2:Q2").Select
ActiveCell.FormulaR1C1 = "='MAIN PAGE'!R[8]C7"
Range("O3:Q3").Select
ActiveCell.FormulaR1C1 = "='MAIN PAGE'!R[7]C8"
Range("O4:Q4").Select
End Sub

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Aaron Evans     Answered On: Nov 05

The issue is in the R[8]C2 value.
the "[8]" implies a relative  distance of 8 cells to the right.
to make it absolute, remove the brackets.
(change it "'MAIN PAGE'!R8C2", etc)

 
Didn't find what you were looking for? Find more on Absolute Reference Or get search suggestion and latest updates.




Tagged: