VBA Macro Assistance

bepedicino

Board Regular
Joined
Sep 29, 2014
Messages
73
I have a spreadsheet where many of the cells contain a scientific notification, I need them to be text cells. I tried changing the format but Excel will not convert the cells unless I double left-click in each cell and then press enter in each of the affected cells.

Could someone please assist by providing me a macro that will double left-click on each cell and then move on to the next cell for all cells in column B of the current active sheet? Or if there is another better solution that would be great. Your assistance is greatly appreciated.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Have you tried doing a text to columns>fixed width> choosing text format.....
 
Upvote 0
Yes, I have. Unfortunately it did not correct the issue.

I am surprised that doesn't work for you.

In any case, maybe a macro like this (untested)
Code:
Sub DoubleClickCells()
    Dim rng As Range
    For Each rng In Selection
        Application.SendKeys "{F2}{ENTER}"
    Next
End Sub

Create a shortcut to run the macro and press shortcut to trigger it. If run from the visual basic editor, you won't get the desired results

Highlight the cells you want to double click and then press shortcut to run macro
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,924
Members
452,366
Latest member
TePunaBloke

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