Hello

I am trying to write some code in VB that will be able to function right in some different sheets, that I dont know their name in advance (the user can duplicate sheets using a macro). First, after a long time of googling I still havent found a decent way to retrieve the active sheet Codename from which I called the function (from a button).

Next, even if I knew the Codename of the current sheet, how do I use it inside the code, for example, replacing:

Worksheets("somename").Range("A1").Value
to
[variable].Range("A1").Value ?

Is it possible?

thanks