Get a worksheet name using Excel VBA

后端 未结 6 895
名媛妹妹
名媛妹妹 2021-01-08 01:29

I would like to create an user-defined function in Excel that can return the current worksheet. I could use the

sheetname = Activ         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-08 01:47

    Function MySheet()
    
      ' uncomment the below line to make it Volatile
      'Application.Volatile
       MySheet = Application.Caller.Worksheet.Name
    
    End Function
    

    This should be the function you are looking for

提交回复
热议问题