ActiveCell.Formula modification

krishna334

Active Member
Joined
May 22, 2009
Messages
391
Hi Experts,

In one of the cells i have the below formula :

ActiveCell.Formula = _
"=""Hi," & Chr(10) & "" & Chr(10) & "Good Day!" & "Please confirm the PO# "" & A2"


What i need is, the last A2 in the formula is not constant i want to use somethig like A & i where "i" will vary.
So, how can i change the formula?

Thanks in advance

Regards

Krishna Kumar
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
So you just have text in the cell? You need a way to assign i. I just used a constant here:

Code:
i = 10
ActiveCell.Value = "Hi," & Chr(10) & Chr(10) & "Good Day! " & "Please confirm the PO#" & Range("A" & i).Value
 
Upvote 0
I think a made a mistake..

I want the formula also to be seen there with A2 being called after the code execute. It does not show the formula now.
Can you do please help me with that?
 
Upvote 0
Something like
Code:
Sub krishna334()
   Dim i As Long
   
   For i = 2 To 10
      Range("B" & i).Formula = "=""Hi,"" & Char(10) & Char(10) & ""Good Day! Please confirm the PO# "" & A" & i
   Next i
End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,024
Members
448,543
Latest member
MartinLarkin

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
Back
Top