set cell value with vba and get the formula in the Excel function bar

MarieBocc

New Member
Joined
Jun 28, 2019
Messages
33
Hello everyone,

I am trying to set the value of a cell by using vba. The thing is, this cell is in a column where all cells are set by the following formula :

[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]=IF(OR((H17<>"");(F17<>"");(E17<>""));SEARCH("zzz";B$9:$B17);"")

So when the user clicks on any cell, this is what the Excel function bar displays. But if I set my cell value with vba, how can I get my cell to display the same formula in the Excel function bar ?

To begin with, is it even possible ?

[/FONT]
Thank you for reading,

Marie
 
Hello again,

I thought about it from a different angle and here is what I came up with and it worked :biggrin: :

[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
Code:
Cells(myRow - 1, 1).AutoFill Destination:=Range(Cells(myRow - 1, 1), Cells(myRow, 1)), Type:=xlFillDefault

note : myRow is the row I want to spread the formula to. (The same formula as I have in the whole column -> so also in the previous cell.)
[/FONT]
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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