PC Review


Reply
Thread Tools Rate Thread

Automating F2 to edit

 
 
Darin Kramer
Guest
Posts: n/a
 
      23rd Apr 2008
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
(E-Mail Removed). 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 ***
 
Reply With Quote
 
 
 
 
James Snell
Guest
Posts: n/a
 
      23rd Apr 2008
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 "private.php?do=newpm&u=" 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
> (E-Mail Removed). 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 ***
>

 
Reply With Quote
 
Darin Kramer
Guest
Posts: n/a
 
      23rd Apr 2008
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 With Quote
 
James Snell
Guest
Posts: n/a
 
      23rd Apr 2008
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Word Edit>SelectAll to Edit>Select>SubMenu like Edit>Clear> =?Utf-8?B?TW9udGUgSGFucmFoYW4=?= Microsoft Word New Users 9 11th Jun 2006 07:52 PM
GridView edit validation, edit dropdown list, delete popup confirm =?Utf-8?B?a2Vu?= Microsoft ASP .NET 1 23rd Jan 2006 12:51 PM
Can't edit Excel worksheet with picture when automating Excel =?Utf-8?B?U3R1bXBpYW5h?= Microsoft Excel Programming 0 9th Nov 2005 01:23 AM
Word 2003 can't select picture editor in tools edit menu or edit p =?Utf-8?B?UGVycGxleGVkIGluIEJyb29rbHlu?= Microsoft Word Document Management 6 3rd Jul 2005 10:26 AM
help-edit copy and edit paste wont work, cant restore files in recycle bin either Neal Windows XP General 1 17th Oct 2004 03:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:37 PM.