Input an F2 to all cells in range in column A

zakynthos

Board Regular
Joined
Mar 28, 2011
Messages
169
I have a problem with Vlookups refreshing in a large data set.

I note that the formula refreshes only when I input an edit (F2) into the cell being looked up.

How would you write VBA to input an F2 to all cells in the range
(example A1:A10000)?

many thanks!
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
You don't really want to do that - you want to recalculate the worksheet:-
Code:
Application.Calculate
Have you got calculation set to manual?
 
Upvote 0
I restrict calculation to specified ranges all the time where my datasets are very large. You can simulate an F2 by replacing = with =:

Range("A1:A1000").Replace "=", "="
 
Upvote 0
Thanks, I agree I don't really want to input lots of F2's manually. I'd rather Excel did what it was supposed to do - calculation options are set to automatic and using an 'application calculate' macro doesn't solve the problem - just doesn't work.

It only refreshes when I enter an F2 into the lookup value in column A.

Do you know anything else I could try, or failing that - VBA to input the a load of F2's to all cells in col A in the range?

Thanks
 
Upvote 0
Thanks for this alternative.

However, I'm using Excel 2007 and have tried this:

Range("A1:A1000").Replace "=", "="

but it doesn't work with this version as far as I can see - I've run it and there's no refresh - still only if I manually enter an F2 into the lookup value in column A.

Any other suggestions welcome
.
 
Upvote 0
Surely it would be preferable to find why the formula is not calculating and fix that instead of looking for a crude workaround.
 
Upvote 0
Thanks for your help again and also for the advice on checking why formula wasn't working - I did try this and also looked at why a few cells were refreshing instantly but most didn't unless F2 + enter was pressed - no luck there, so it remained a mystery to me!!!!:confused:

So if anyone can explain why Excel 2007's not doing it's thing when confronted with large data sets of vlookups I'd bereally interesed to know.

If anyone else has this problem, I've done a bit of research and adapted some code and this does solve the problem at last!:laugh:


Code:
Sub Text2Number()


Dim i As Long

For i = 1 To 10000


Cells(i, 1).Select

ActiveCell.Value = ActiveCell.Value

Next i

End


End Sub
 
Upvote 0
Code:
Sub [COLOR=red]Text2Number[/COLOR]()
 ....
End Sub

The name of your procedure shows some previously missing information, that would suggest the fix would be.

Select column A in excel then on the excel ribbon Data > Text to columns > Finish.
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,687
Members
452,938
Latest member
babeneker

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