Hi. well i'm not very efficent in vba as of right now and i need someone to translate the following for me into VBA if possible.
Thanks
Code:
dim sheetName as string
dim isSheet as bool
if more than 1 cell is selected than
msgbox ("too many cells selected")
exit sub
else
sheetName = Trim(selectedcell.text)
end if
for i=1 to total amount of sheets(sheets.count?)
if Sheet(i).name = sheetName then
isSheet = true (sheetwork exists with such name)
msgbox("sheet " & sheetName & " already exists.")
exit loop
end if
next i
if not isSheet then
sheets.add
sheets.name = sheetName
ActiveWorkbook.Save
ActiveWorkbook.Close
end if