vba issues

Hi,

When i am trying to create a new worksheet in a workbook via vba code , i am getting an error :- 'The command can not be used for multiple selections'.

The following code used:-

Sheet.Add After:=ActiveSheet

I have tried worksheets.Add,ActiveWorkbook.ActiveSheet.Add but stuck with same error.

Even i have tried also by making an object of worksheet.

My macro is running perfectly 2 or 3 times but after that i got error with command can not be used for multiple selections.

Manually i am not able to create sheets after got this error.

Please help me.

Nick's picture

sounds like you have more

sounds like you have more than one worksheet selected

try putting this line of code before selecting the sheet you want to add the new sheet after:

sheets(1).select