How to get a macro to double click a cell then move to the next

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi everyone,

Ok i'll try not to confuse the situation by explaining why I need this done, i'll just say it vital for what I'm trying to do.

So what I need is a macro that will double click a cell so the curser is in it then click enter so it moves out!

If you want I little move detail here goes but please don't get confused by this part!

I have a list of websites without hyperlinks in column A,
when I double click the cell with the webaddress in it then press enter it turns the webaddess into a hyperlink,
I need this done on about 2000 lines so I need a macro that will simulate double clicking or entering into the cell then pressing enter
if you want to test what I'm talking about put www.bbc.com into a cell right click and remove the hyperlink,
Then double click on the cell and the curser goes into the cell, not selecting the cell but inside it so you can edit the contents, now press enter and the cell with get a hyperlink,
this is what I want.

any ideas how I would do this?
Tony
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Thanks for your advice VoG but I don't no how to set this up,
I got this code and tried to make it work but the web address is in the cell? im totally confused!
 
Upvote 0
As an example with

www.microsoft.com

(not a hyperlink) in A1 - place the hyperlink in B1

Code:
Sub test()
With Range("A1")
    .Offset(, 1).Hyperlinks.Add Anchor:=Range("B1"), Address:="http:/" & Range("A1").Value, TextToDisplay:=Range("A1").Text
End With
End Sub

You should be able to loop this.
 
Upvote 0
This is an example for Sheet3 column A, change as necessary
Code:
Sub Addhyperlink()
    Dim I As Integer, wks As Worksheet
    Set wks = Worksheets("Sheet3")
    For I = 1 To Range("A" & Rows.Count).End(xlUp).Row
        wks.Hyperlinks.Add Anchor:=Range("A" & I), Address:=Range("A" & I).Value
    Next I
End Sub
 
Upvote 0
Momentman! you are amazing! exactly what I needed, thank you so much, I would never have got there on my own! the range & I works perfectly,
A big big thank you.
Tony
 
Upvote 0
Momentman! you are amazing! exactly what I needed, thank you so much, I would never have got there on my own! the range & I works perfectly,
A big big thank you.
Tony

You are very much welcome
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top