Results 1 to 4 of 4
  1. #1
    natonstan is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2014
    Posts
    37

    That name is already taken. Try a different one

    I'm getting an error with the below snippet of code, for some reason it seems to want to create another sheet with the same name 'DkRateVariances' The sheet name is not mentioned anywhere else in my code and if I change that page name I still get there error, can anyone help me fix this?



    Code:
    Sheets.Add.Name = "DkRateVariances"
    Set DKData = ActiveSheet
    myRow = 4
    myCol = 4
    Do Until CADsheet.Cells(2, myCol) = ""
        DKData.Cells(myRow, 1) = CADsheet.Cells(2, myCol)
        myCol = myCol + 1
        myRow = myRow + 1

  2. #2
    Datamulcher is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2016
    Location
    Victoria, Canada
    Posts
    26
    Sheets.Add.Name = "DkRateVariances" is a command to create a sheet with the name "DkRateVariances".
    What is your goal with your code?

  3. #3
    natonstan is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2014
    Posts
    37
    Exactly that, I do want the new sheet with that title, however judging by the error I'm getting it seems to be trying to create it twice? Nowhere else in my macro is this sheet referenced.

  4. #4
    Kudos is offline Novice
    Windows 8 Access 2013 32bit
    Join Date
    Mar 2017
    Location
    Toronto, ON
    Posts
    29
    Check for hidden tabs and then step through your code and make sure it's not looping somewhere. Also, this looks like an Excel VBA question rather than an Access macro question. Might want to move to a different forum.

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums