Pulling my hair out....
I have 8 sheets in a project and each has its own textbox named htmlbox1, htmlbox2, etc.
Want code to check which sheet is active and then send output to the appropriate textbox.
Tried this:
[vba]If ActiveSheet.codename = "Sheet1" Then
i = 1
End If
If ActiveSheet.codename = "Sheet2" Then
i = 2
End If[/vba]
etc........then send the resultant output to the textbox associated with that active sheet.....
[vba]ActiveSheet.("htmlbox" & i).Text = "whatever"[/vba]
I'm new and I've tried everything I know.
Thanks
Pete