Update cell value by Command button

[Closed]
Report
Posts
22
Registration date
Friday October 19, 2012
Status
Member
Last seen
June 22, 2013
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,

I would be very grateful if someone can help me in the following issue.
I have excel sheet with almost 300 rows.
One of the columns I fill it through copy/paste as Value from another source. Then I goes to each cell (for example starting from C2 until C320 by doing the following: in each of the mentioned cells I press "F2" button then enter, "F2" then enter, ...etc until C320.

What I need, VBA code through command button to do this process of ("F2" enter).

Of course this process I need it to activate or to update the current format in each cell.

Thanks in advance to any support or help.
Best regards,

3 replies

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
I am bit confused here.
F2 key is supposed to make a cell ready for edits. So are you saying that you press F2, and then just type "f2" in the cell ?
Posts
22
Registration date
Friday October 19, 2012
Status
Member
Last seen
June 22, 2013

Hi Rizvisa1,
Thanks a lot to your help.

I need a command button to make the process of pressing "F2" which is for edit as you said and then to press Enter. I don't want to change the cells contents. I'm doing this process to update the cell value format. For example if cell C3 content is (55555) and I change the format through "Customize" to be like this(55-555) so it will not take this effect unless I pressed F2 then enter.

Therefore, I don't need to fill or to type any thing, just pressing F2 then Enter.

This process I need it for this range (C3:C320).

Thank you in advance.
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
try this
1 Select range C3:C320
2. Goto to Data --> Text To Columns and click
3. In the wizard, select "Delimited" and press next
4. Unselect all check boxes and press next
5. select "General" and press finish
6. apply the format that you wanted

see if this works for u.
Thanks a lot again rizvisa1,

I tried all the steps as mentioned, but the same result, I mean after I did all the steps, I copied and pasted values to the mentioned range (C3:C320 ) but it didn't took the defined formats, so for each cell I pressed "F2" then pressed "Enter" to take the defined formats.

Isn't there any code to do this process of "F2" then "Enter" for that list?

Thanks a lot,
Issa
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Issa, could you please post a sample book with some sample data that has that issue. for ,me it worked. For posting book, choose as public file sharing site and post back the link to the file back here

thanks
Ok, I will post an example, but how can I do that? I never did it before!

Thanks a lot.
BR,
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Issa, try using speedyshare.com. You can upload file there. It will give you a link to the file, copy that link and paste it back here