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,045
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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,045
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
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!
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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.
 

Momentman

Well-known Member
Joined
Jan 11, 2012
Messages
4,142
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS

ADVERTISEMENT

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
 

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,045
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
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
 

Momentman

Well-known Member
Joined
Jan 11, 2012
Messages
4,142
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,028
Messages
5,856,932
Members
431,839
Latest member
Guest user

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
Top