Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA to put active cell in edit mode

Status
Not open for further replies.

dgillz

Instructor
Mar 2, 2001
10,043
US
I have an excel spreadsheet with a column that is a web address, but it is there as text. If I go to that column, hit F2 to edit, and then enter, viola! The cell is a clickable web address.

So I thought I'd write some simple code to turn them all into web addresses, (there being 8,000+ of them) but I can't figure out how to do it. First of all if I record these keystrokes as a macro it does something similar to this:

Code:
ActiveCell.FormulaR1C1 = "[URL unfurl="true"]www.tek-tips.com"[/URL]
Range("G11").Select

So it a) never records the fact that I hit F2 to go into edit mode and b) recorded the literal value already in the cell as the active cells formula.

I know how to do a simple loop, but I cannot figure out how to put a cell in edit mode with VBA.

Any help appreciated.

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 

hi,

SELECT in the column you want to process...
Code:
dim r as range

with selection
   for each r in .parent.range(.parent.cells(.parent.usedrange.row, .column), .parent.cells(.parent.usedrange.row+.parent.usedrange.rows.count-1, .column))
      with r
         .value = .value
      end with
   next
end with


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Alternative solution with hyperlinks:
[tt]Dim c As Range
For Each c In Selection
c.Hyperlinks.Add Anchor:=c, Address:=c
Next c[/tt]


combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top