Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default make a data entry into hyperlink using vba?

I use vba for a programme where people can enter data into a sheet by using
textboxes. My problem is that I need to make the entry into textbox9 to
appear as hyperlink. and I want the entry into textbox9 to be a hyperlink
that links to ENTRY.dwg. so let say the person enters ANTON in textbox9 the
entry will become hyperlink to the file ANTON.dwg. Hope this helps to give a
clearer picture. my programme is as follow


Private Sub CommandButton1_Click()
Dim LastRow As Object

Set LastRow = Sheet3.Range("a65536").End(xlUp)

LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 1).Value = TextBox2.Text
LastRow.Offset(1, 2).Value = TextBox3.Text
LastRow.Offset(1, 3).Value = TextBox4.Text
LastRow.Offset(1, 4).Value = TextBox5.Text
LastRow.Offset(1, 5).Value = TextBox6.Text
LastRow.Offset(1, 6).Value = TextBox7.Text
LastRow.Offset(1, 7).Value = TextBox8.Text
LastRow.Offset(1, 8).Value = TextBox9.Text
LastRow.Offset(1, 9).Value = TextBox10.Text
MsgBox "One entry added to Database"

End If

response = MsgBox("Do you want to add another entry?", _
vbYesNo)

If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""

TextBox1.SetFocus

Else
MsgBox "Thank you, God bless you"
Unload Me
End If

End Sub

Private Sub CommandButton2_Click()
MsgBox "Thank you, God bless you"
End
End Sub




Thanks lots!
Anton

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default make a data entry into hyperlink using vba?

On Jan 11, 3:46*pm, Anton wrote:
I use vba for a programme where people can enter data into a sheet by using
textboxes. My problem is that I need to make the entry into textbox9 to
appear as hyperlink. and I want the entry into textbox9 to be a hyperlink
that links to ENTRY.dwg. so let say the person enters ANTON in textbox9 the
entry will become hyperlink to the file ANTON.dwg. Hope this helps to give a
clearer picture. my programme is as follow

Private Sub CommandButton1_Click()
Dim LastRow As Object

Set LastRow = Sheet3.Range("a65536").End(xlUp)

LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 1).Value = TextBox2.Text
LastRow.Offset(1, 2).Value = TextBox3.Text
LastRow.Offset(1, 3).Value = TextBox4.Text
LastRow.Offset(1, 4).Value = TextBox5.Text
LastRow.Offset(1, 5).Value = TextBox6.Text
LastRow.Offset(1, 6).Value = TextBox7.Text
LastRow.Offset(1, 7).Value = TextBox8.Text
LastRow.Offset(1, 8).Value = TextBox9.Text
LastRow.Offset(1, 9).Value = TextBox10.Text
MsgBox "One entry added to Database"

End If

response = MsgBox("Do you want to add another entry?", _
vbYesNo)

If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""

TextBox1.SetFocus

Else
MsgBox "Thank you, God bless you"
Unload Me
End If

End Sub

Private Sub CommandButton2_Click()
MsgBox "Thank you, God bless you"
End
End Sub

Thanks lots!
Anton


That would look something like that:

with sheet3

.Hyperlinks.Add Anchor:=Selection, Address:= _
TextBox9.Text & ".dwg", TextToDisplay:= _
TextBox9.Text

end with
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default make a data entry into hyperlink using vba?

Hi Carlo, thanks for the help. However there is still a small problem. The
hyperlink does not appear on the intended cell but instead it appears on
wherever cell that I have clicked on before I run the macro. Is there any way
that maybe we can align the address with the textbox9 address?

Thank you so much

"carlo" wrote:

On Jan 11, 3:46 pm, Anton wrote:
I use vba for a programme where people can enter data into a sheet by using
textboxes. My problem is that I need to make the entry into textbox9 to
appear as hyperlink. and I want the entry into textbox9 to be a hyperlink
that links to ENTRY.dwg. so let say the person enters ANTON in textbox9 the
entry will become hyperlink to the file ANTON.dwg. Hope this helps to give a
clearer picture. my programme is as follow

Private Sub CommandButton1_Click()
Dim LastRow As Object

Set LastRow = Sheet3.Range("a65536").End(xlUp)

LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 1).Value = TextBox2.Text
LastRow.Offset(1, 2).Value = TextBox3.Text
LastRow.Offset(1, 3).Value = TextBox4.Text
LastRow.Offset(1, 4).Value = TextBox5.Text
LastRow.Offset(1, 5).Value = TextBox6.Text
LastRow.Offset(1, 6).Value = TextBox7.Text
LastRow.Offset(1, 7).Value = TextBox8.Text
LastRow.Offset(1, 8).Value = TextBox9.Text
LastRow.Offset(1, 9).Value = TextBox10.Text
MsgBox "One entry added to Database"

End If

response = MsgBox("Do you want to add another entry?", _
vbYesNo)

If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""

TextBox1.SetFocus

Else
MsgBox "Thank you, God bless you"
Unload Me
End If

End Sub

Private Sub CommandButton2_Click()
MsgBox "Thank you, God bless you"
End
End Sub

Thanks lots!
Anton


That would look something like that:

with sheet3

.Hyperlinks.Add Anchor:=Selection, Address:= _
TextBox9.Text & ".dwg", TextToDisplay:= _
TextBox9.Text

end with

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
Is it possible in Excel to make a cell mandatory for data entry? Ben Joseph Excel Discussion (Misc queries) 1 April 2nd 09 10:29 PM
Shortcut to make a drop-down LOV show during data entry? MNGopher Excel Discussion (Misc queries) 1 February 24th 09 11:13 PM
How do I make tab automatic in an excel data entry form? Greattude New Users to Excel 2 August 13th 08 09:52 PM
Can I make a data entry box? gobonniego Excel Discussion (Misc queries) 3 February 1st 07 03:36 AM
want to make a formula for a data entry in the same cell in excel kufo79 Excel Discussion (Misc queries) 7 July 29th 06 04:23 PM


All times are GMT +1. The time now is 03:16 PM.

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

About Us

"It's about Microsoft Excel"