By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,806 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,806 IT Pros & Developers. It's quick & easy.

vb excel help

P: 1
I have this excel file that I have created. I wanted to set it up to be multi-user friendly. So essentially what i have done was at startup, i ask for a user name and password. Then the code runs through a worksheet and checks for user name and password. If the password cannot be verified it copies a worksheet for the user to fill out. But for some reason I keep getting an error on the copy worksheet routine. Here is the code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CopySheets()
  2.     Dim wsh As Worksheet
  3.     ActiveWorkbook.Sheets("SRC").Copy _
  4.     After:=ActiveWorkbook.Sheets(ActiveWorkbook.Sheets.Count)
  5.     Set wsh = ActiveSheet
  6.     wsh.Name = userName & " SRC"
The error im getting is a Run-time error '1004', Application-defined or object-defined error.

I have tried using the code several different ways but I have not been able to get it to work. Can anyone give me a reccomendation?
Mar 26 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.