PDA

View Full Version : add formula to first available cell column B



adma
07-05-2018, 06:14 AM
Hi,

What do I need to change this code to so that is doesn't add my formula to R18 C1, but instead adds it to the first available cell in B: ActiveCell.FormulaR1C1 = "=NEW!R[-18]C[1]"

the formula I want to add to the cell will be: ='NEW'!C2 (basically I want to copy from NEW cell C2, and see that in another Sheet)


Sub new_1()
'
' new_1 Macro
'


'
Sheets("TEMPLATE").Select
Sheets("TEMPLATE").Copy After:=Sheets(8)
Sheets("TEMPLATE (2)").Select
Sheets("TEMPLATE (2)").Name = "NEW"

Sheets("Summary").Select
Dim foundBlank As Range
Set foundBlank = Range("B3:B1000").Find(What:="", lookat:=xlWhole)
foundBlank.Select


ActiveCell.FormulaR1C1 = "=NEW!R[-18]C[1]"
ActiveCell.Offset(0, 1).Select

ActiveCell.FormulaR1C1 = "='NEW '!R[-3]C[1]"


End Sub

MINCUS1308
07-05-2018, 08:28 AM
adma,
Is this a different question or was it resolved with my solution to your other post:
http://www.vbaexpress.com/forum/showthread.php?63118-VBA-code-not-working&p=381747#post381747

adma
07-09-2018, 12:43 AM
it is the same sorry