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

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

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,722
Or even:
Code:
ActiveCell.Value= Range("completename").Offset(-1, 0).Value
 

Forum statistics

Threads
1,171,829
Messages
5,877,798
Members
433,287
Latest member
amna_shahbaz

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