1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

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

Discussion in 'Business Applications' started by mon645, Mar 4, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. mon645

    mon645 Thread Starter

    Joined:
    Mar 4, 2007
    Messages:
    2
    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
     
  2. Jimmy the Hand

    Jimmy the Hand

    Joined:
    Jul 28, 2006
    Messages:
    1,220
    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
     
  3. Zack Barresse

    Zack Barresse

    Joined:
    Jul 25, 2004
    Messages:
    5,447
    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). :)
     
  4. BAD-DADDY

    BAD-DADDY

    Joined:
    Aug 1, 2008
    Messages:
    1
    Jimmy,

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

    Roger
     
  5. Aj_old

    Aj_old

    Joined:
    Sep 24, 2007
    Messages:
    869
    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 Files:

  6. Sponsor

As Seen On
As Seen On...

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.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/549086