i have a commandbutton on a userform. when clicked this command button creates a worksheet.This is done. but the problem is that i want the worksheet's name to be the same as the commandbutton's caption.Any help please
i have a commandbutton on a userform. when clicked this command button creates a worksheet.This is done. but the problem is that i want the worksheet's name to be the same as the commandbutton's caption.Any help please
Hello,
show your code and we can help you to amend it.
Greetings
Tor
@ideatronz;
See this:
![]()
Private Sub CommandButton1_Click() For i = 1 To Sheets.Count If Sheets(i).Name = CommandButton1.Caption Then GoTo theExit: Next Set newSH = Worksheets.Add newSH.Name = CommandButton1.Caption theExit: End Sub
Last edited by Haluk; 07-31-2020 at 05:28 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks