Code to 'click' in formula bar and press enter, IF that's what's needed?

dougbert

Board Regular
Joined
Jul 12, 2007
Messages
91
Hi all!

I'm looking for code that would allow me to 'activate' 1000's of concatenated formulas that have been trimmed via another formula, the resulting displayed formulas copied and pasted as 'values'. Unfortunately, the pasted 'formulas' don't activate and act as 'real' formulas. Yet, they truly do work! Read on...

Let me try to break this down in an effort to make what I just said more understandable.

For simplicity: cells D2:I2 each contain a text portion of a formula. Cell C2 contains the CONCATENATE formula assembling cells D2:I2. The final concatenated formula is a formula containing links to cells in closed files (100's). The assembled concatenated formula is of the basic form:

'=IF(ISBLANK('fully qualified path hyperlink to a single cell in a closed workbook'),"",'fully qualified path hyperlink to a single cell in a closed workbook')

All syntax in the displayed concatenated formula is correct, EXCEPT for the leading apostrophe which was necessary because cell D2 contained the '=' sign followed by the beginning fragment of the final formula. So, it needed to be viewed as text by Excel.

Cell B2 contains the following formula which strips off the leading apostrophe, so that the displayed formula begins with the '=' sign:
=RIGHT(C2,LEN(C2)-1)

The 'value' displayed in cell B2 is a perfect syntax assembly of the final concatenated formula. So, to commit that value to B2 (and 1000's of other similarly constructed cells), I copy the cell and paste back into the same cell as a value, since pasting as a forumula would have just pasted
=RIGHT(C2,LEN(C2)-1), which obviously isn't what I want.

Now, you might be thinking that I could just copy the displayed 'value' formula and paste as a formula and all would be well. Well...no. It doesn't work that way...:(

However, to PROVE the resultant formula actually was correct and would work, I clicked anywhere in the resultant formula in the formula bar and pressed 'Enter'. Voila! The value in the external closed workbook displayed correctly. Yay!

Here's the catch. I'd have somewhere in the neighborhood of 30,000 cells plus to click in each cell's formula bar and press 'Enter' in order to see the linked value!!! Pressing 'Enter' alone does NOT work. Can you say Carpal Tunnel Syndrome!? :(

Naturally, I'm hoping someone has already been faced with a similar situation and knows exactly what to do to 'activate' the contents of these 10,000's of cells. If not, I'm hoping someone knows some clever code where I could specify the range of cells to 'activate' and have them do their 'thing'!

BTW: I've tried saving/closing/re-opening the workbook to see if Excel would just 'do it'. No...it won't.

NOTE: I didn't use the INDIRECT function as it won't work on external, closed workbooks. Yes, I've heard of INDIRECT.EXT, but this is a shared workbook and I didn't want to try to train managers on how to install the add-in.

Bottom Line: the final 'formulas' have valid syntax and DO work as long as I was of a mind to do all the manual formula bar clicking and pressing 'Enter'. I'm not! :eeek:

Please let me know if this is still unclear. I'll be happy to elaborate, if necessary. Thanks for any and all suggestions/code, etc.!!!
 
Last edited:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,224,524
Messages
6,179,304
Members
452,904
Latest member
CodeMasterX

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