Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

Excel Macro that does "F2 and Enter" for a range of cells


(!)

mon645's Avatar
mon645 mon645 is offline
Junior Member with 2 posts.
THREAD STARTER
 
Join Date: Mar 2007
Experience: Advanced
04-Mar-2007, 04:17 PM #1
Excel Macro that does "F2 and Enter" for a range of cells
Hi, I have a column in Excel that consists with time (minutes) from 0 to 80. I need a macro that will take each cell within a range (let say a column A1 to A6000) and do F2 and enter to each of the cells. I have too many cells to do it manualy..F2=>Enter. My lookup won’t recognize the numbers unless I do so. Can you help?

Thanks
Jimmy the Hand's Avatar
Member with 1,220 posts.
 
Join Date: Jul 2006
Location: Hungary
Experience: Level 15 Paladin
05-Mar-2007, 02:44 AM #2
Hi

This macro does what you asked for:
Code:
Sub test2()
    Dim c As Range
    For Each c In Range("A1:A6000").Cells
        c.Select
        SendKeys "{F2}", True
        SendKeys "{ENTER}", True
    Next
End Sub
However, I think there might be other solutions, quicker and/or simpler ones. To be more specific, I suspect this to be a cell formatting issue. But without a closer look I can't tell.

Jimmy
Zack Barresse's Avatar
Computer Specs
Member with 5,434 posts.
 
Join Date: Jul 2004
Location: Oregon, United States
Experience: I'ma learnin'!
05-Mar-2007, 11:53 AM #3
Eww, ugly, no, yuck, wrong! Try Text to Columns. Next time you post for help, post what your problem is, not what you want as a solution. We keep learning much more open this way (for all of us).
BAD-DADDY's Avatar
BAD-DADDY BAD-DADDY is offline
Junior Member with 1 posts.
 
Join Date: Aug 2008
Experience: Beginner
01-Aug-2008, 08:38 AM #4
Jimmy,

This does EXACTLY what I needed. Many thanks and best regards.

Roger
Aj_old's Avatar
Aj_old Aj_old is offline
Computer Specs
Senior Member with 869 posts.
 
Join Date: Sep 2007
Location: Moldova
Experience: Intermediate
04-Aug-2008, 01:02 AM #5
Quote:
Originally Posted by mon645 View Post
Hi, I have a column in Excel that consists with time (minutes) from 0 to 80. I need a macro that will take each cell within a range (let say a column A1 to A6000) and do F2 and enter to each of the cells. I have too many cells to do it manualy..F2=>Enter. My lookup won’t recognize the numbers unless I do so. Can you help?

Thanks
If all your cells consist of numbers stored as text you could do one of this:
add a new column, and write this formula:
Code:
 =A1+0
or
Code:
 = Value(A1)
and copy it for all cells in column A and use this column for calculations or just copy and paste special, value only, on column A , and work with column A

The second solution is to select the cells that contain numbers stored as text, select all of them and in the first cell you'll have on the right side an exclamation sign, click on it and select Convert to number! This way you'll have all your cells that contains numbers converted to numbers!
Attached Images
File Type: bmp New Picture (17).bmp (177.2 KB, 1293 views)
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑