How can I create a URL with link using the VBA form.

  • Thread starter Thread starter Daniel
  • Start date Start date
D

Daniel

I have created a form for user entry to add a record. The form consist
of a column which allows user to enter a URL of a web site. The value
can be inserted to the cell successfully, however, the url is just
displayed as a text with a link. So I want to ask how can I create the
link automatically?

Thanks
 
One way is to add the string as part of an =hyperlink() formula:

Say they type www.ms.com (no http://).

then this would work:

Worksheets("sheet1").Range("a1").Formula _
= "=hyperlink(""http://" & myForm.TextBox1.Value & """)"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top