Hi,
I'm pretty new to VBA. Not sure what I did wrong (or right). I'm creating a document to follow different properties. When a new page is created and filed, I want the name to appear on Index sheet with an hyperlink to this very page.
How to do that?
I want to be able to update my page according to the different step were in (a list of checkbox). But when I update it just copy the same name to Index list, which is not really convenient. How to delete or update the same cell?
Thanks a million!!
Sub UpdateAVann()
' Variables
Import_name = ActiveSheet.Cells(7, 3)
index_last_row = Sheets("Index").Cells(Rows.Count, 2).End(xlUp).Row
'Prompt message if name is blank
If IsEmpty(Import_name) Then
MsgBox "Tanpri, Mete Non pwojè a anvan ou update dokiman an.", vbCritical, "Atansyon!"
Else
index_last_row = Sheets("Index").Cells(Rows.Count, 2).End(xlUp).Row
'Delete name in Index if there already
For i = index_last_row To Sheets("Index").Cells(4, 2) Step -1
If Sheets("Index").Cells(i, 2) = "activesheet" Then
Sheets("Index").Cells(i, 2).Delete.Content
End If
Next i
'Rename Sheet name according to name
ActiveSheet.Name = Import_name
'Import name to Index list
Sheets("Index").Cells(index_last_row + 1, 2).Value = ActiveSheet.Cells(7, 3)
End If
End Sub