ActiveCell.Formula = result FALSE

Forestq

Active Member
Joined
May 9, 2010
Messages
482
hi,

I have simply formula in loop:
Code:
Set WS = WB.Sheets("Sheet2")
Dim b as String

For j=1 to 6
     b = ActiveCell.Formula = "=MID(Right(WS.Cells(j, 2),9),1,6)"
next j

and my result is always false. Do you know why?
 
Last edited:

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
b now returns the value of ActiveCell.Formula = "=MID(Right(WS.Cells(j, 2),9),1,6)"
which is false if the active cell does not have exactly that formula.

could you please elaborate what you're trying to accomplish?
 
Upvote 0
in the cell I have values likes:
B1 = AAAAAAAAAAA - N12345-CN
B2 = AAAABBBCCCCC - N12345-BS

I want to substitute into value "b" reuslt from formula

Normally in excel I have = MID(RIGHT(12,9),1,6) and it's fine
 
Upvote 0
Then try

Code:
b=MID(Right(WS.Cells(j, 2),9),1,6)

instead of

Code:
b = ActiveCell.Formula = "=MID(Right(WS.Cells(j, 2),9),1,6)"
 
Upvote 0

Forum statistics

Threads
1,215,411
Messages
6,124,759
Members
449,187
Latest member
hermansoa

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