Hello,
That is my first post here and also first contact with VBA.
I have created one basic code, very simple, but, it works
The name of new client is to be inserted in worksheet 1, "Baza", cell A4.
Then, this macro creates new Sheet, the name of this sheet is the same as a name of new client typed in sheet 1, "Baza", cell A4.
Then, new row is added in sheet 1, "Baza", (A9) and name of new client from "Baza" A4 is inserted.
And I am stucked here. I would like this macro to create a hyperlink on freshly inserted client name in row 9, sheet 1, "Baza" - when click on new name, it should take me to the related sheet.
This is what I got so far.
Sub Dodawanie()
'stop if emtpy
If Range("A4").Value = "" Then
Exit Sub
End If
'insert new row
Range("A9").EntireRow.Insert
Range("A4").Copy Range("A9")
'copy oswiadczenie
Sheets("Oświadczenie wzór").Select
Sheets("Oświadczenie wzór").Copy After:=Sheets(2)
'change of sheet name
Sheets(3).Name = Sheets(1).Range("A4")
'clear A4
Sheets(1).Range("A4").ClearContents
'activation of main sheet
Worksheets("Baza").Activate
End Sub
Could you pls give some advice how to create hyperlink on A9 in sheet 1 to take me to the sheet with the same name ??
I will really appreciate your help.
Cheers,
Peter
That is my first post here and also first contact with VBA.
I have created one basic code, very simple, but, it works
The name of new client is to be inserted in worksheet 1, "Baza", cell A4.
Then, this macro creates new Sheet, the name of this sheet is the same as a name of new client typed in sheet 1, "Baza", cell A4.
Then, new row is added in sheet 1, "Baza", (A9) and name of new client from "Baza" A4 is inserted.
And I am stucked here. I would like this macro to create a hyperlink on freshly inserted client name in row 9, sheet 1, "Baza" - when click on new name, it should take me to the related sheet.
This is what I got so far.
Sub Dodawanie()
'stop if emtpy
If Range("A4").Value = "" Then
Exit Sub
End If
'insert new row
Range("A9").EntireRow.Insert
Range("A4").Copy Range("A9")
'copy oswiadczenie
Sheets("Oświadczenie wzór").Select
Sheets("Oświadczenie wzór").Copy After:=Sheets(2)
'change of sheet name
Sheets(3).Name = Sheets(1).Range("A4")
'clear A4
Sheets(1).Range("A4").ClearContents
'activation of main sheet
Worksheets("Baza").Activate
End Sub
Could you pls give some advice how to create hyperlink on A9 in sheet 1 to take me to the sheet with the same name ??
I will really appreciate your help.
Cheers,
Peter