• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Make a combination of 2 lists in one code

I have a piece of code that works great (thanks to Narayan)
When i change a worksheetname the list changes to
I would like to combine a second list into the code
First code that works fine
Code:
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
If Sh.Name <> PrevShtName Then
With Application
.EnableEvents = False
.Index([List_of_Sheets], .Match(IIf(VBA.IsNumeric(PrevShtName), Val(PrevShtName), PrevShtName), [List_of_Sheets], 0)).Value = Sh.Name
.EnableEvents = True
End With
End If
End Sub
I would like to combine it with a second list
something like this
Code:
.Index([List_of_Sheets1], .Match(IIf(VBA.IsNumeric(PrevShtName), Val(PrevShtName), PrevShtName), [List_of_Sheets1], 0)).Value
Any suggestion welcome
 
Back
Top