Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Automating F2 to edit

Hi there,

In column f I have a formlae which uses a function to creae an email
address from a Excel hyperlink.
I then take the contents of column f and past values into column g - so
now within column g I have the actual email address - eg
. Problem is the Excel is not recognising this as an
email address. If I press F2 to edit the cell, change nothing, and then
press enter it recognises it as an email address.

Question is, how can I automate the process for all entries in column G,
ie edit the cell, and then "press enter" without making a change to the
contents?

Kind Regards

D

*** Sent via Developersdex
http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Automating F2 to edit

The only way you can do the auto-stuff is via the UI, which means sendkeys
(which is very bad indeed).

Instead you'd need to loop through the values and add the hyperlinks in the
format " where links needed to be added.

Something like...

Set target = Sheet1.Range("c2")
Sheet1.Hyperlinks.Add target, "mailto:" & target.Value



"Darin Kramer" wrote:

Hi there,

In column f I have a formlae which uses a function to creae an email
address from a Excel hyperlink.
I then take the contents of column f and past values into column g - so
now within column g I have the actual email address - eg
. Problem is the Excel is not recognising this as an
email address. If I press F2 to edit the cell, change nothing, and then
press enter it recognises it as an email address.

Question is, how can I automate the process for all entries in column G,
ie edit the cell, and then "press enter" without making a change to the
contents?

Kind Regards

D

*** Sent via Developersdex
http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Automating F2 to edit

Thanks for the reply - my VB skills are at the basic level... what would
I need next after the two lines you proposed...?

Regards

D



*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Automating F2 to edit

That's just a demo of how to do one cell. Here's the full code.

Sub SetHyperlinks()
Dim target As Range

For Each target In Sheet1.Range("G1:G65535").Cells
If target.Hyperlinks.Count = 0 Then
If InStr(target.Value, "@") 0 Then
target.Hyperlinks.Add target, "mailto:" & target.Value
End If
End If
Next target
Set target = nothing
End Sub


"Darin Kramer" wrote:

Thanks for the reply - my VB skills are at the basic level... what would
I need next after the two lines you proposed...?

Regards

D



*** Sent via Developersdex http://www.developersdex.com ***

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
automating (alt & f11) pswanie Excel Programming 6 January 20th 08 05:19 PM
Can't edit Excel worksheet with picture when automating Excel Stumpiana Excel Programming 0 November 9th 05 01:23 AM
Why can't I edit my excel document? Edit buttons shaded. Arl @ CBC New Users to Excel 3 September 7th 05 01:18 AM
Automating using VBA Automate my database Excel Worksheet Functions 1 September 1st 05 01:51 PM
Automating PP from XL Keith R[_3_] Excel Programming 0 November 20th 03 08:42 PM


All times are GMT +1. The time now is 07:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"