Offset inside formula code

fabriciofcmiranda

Board Regular
Joined
Jun 27, 2006
Messages
62
I have this code:

Code:
    Range("projectname").Offset(-1, 0).Select
    ActiveCell.FormulaR1C1 = "=completename"
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

The fact is I need to transform the "completename" into "completename.Offset(-1, 0)", since the cell I need to reffer to is the one right above "completename", that changes each time I insert a new line. But I can't figure out a way to transform this into a valid code. Can anyone help me?

Thank you very much!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Or maybe:

Code:
ActiveCell.Formula = "=" & Range("completename").Offset(-1, 0).Address(False,False)
 

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,723
Or even:
Code:
ActiveCell.Value= Range("completename").Offset(-1, 0).Value
 

Forum statistics

Threads
1,176,502
Messages
5,903,425
Members
435,029
Latest member
excelvbanoob420

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top