+ Reply to Thread
Results 1 to 2 of 2

rangeArray(i).Select Error

  1. #1
    Registered User
    Join Date
    12-27-2017
    Location
    Miami
    MS-Off Ver
    Windows 7
    Posts
    1

    rangeArray(i).Select Error

    Hello helpful, smart people,

    The only way I could overwrite 1 and 10 differently was with If statements. Now I am getting an error on [rangeArray(i).Select]. Why though? I am not that smart in VBA so any fixing this would be fanFreakntasticly appreciated. Summary goal: Go through columns P,U,V,W and replace numbers.

    [code]
    Sub ReplaceReasonForVisit()

    Const yy As Integer = 3

    Dim rangeArray(yy) As Range

    Set rangeArray(0) = Sheet1.Range("P:P")

    Set rangeArray(1) = Sheet1.Range("U:U")

    Set rangeArray(2) = Sheet1.Range("V:V")

    For i = 0 To (yy - 1)

    rangeArray(i).Select

    Next i


    If ActiveCell.Value = "1" Then
    ActiveCell.Value = "Change Toner"
    End If
    If ActiveCell.Value = "2" Then
    ActiveCell.Value = "Copy Quality"
    End If
    If ActiveCell.Value = "3" Then
    ActiveCell.Value = "Customer Care"
    End If
    If ActiveCell.Value = "4" Then
    ActiveCell.Value = "Installation/Moves/Removals"
    End If
    If ActiveCell.Value = "5" Then
    ActiveCell.Value = "(Emergency) Supply Orders"
    End If
    If ActiveCell.Value = "6" Then
    ActiveCell.Value = "Error Code"
    End If
    If ActiveCell.Value = "7" Then
    ActiveCell.Value = "Fax Issue"
    End If
    If ActiveCell.Value = "8" Then
    ActiveCell.Value = "Paper Jam"
    End If
    If ActiveCell.Value = "9" Then
    ActiveCell.Value = "Network Issue"
    End If
    If ActiveCell.Value = "10" Then
    ActiveCell.Value = "Malfunction"
    End If
    If ActiveCell.Value = "11" Then
    ActiveCell.Value = "UPrint/Pharos System"
    End If
    If ActiveCell.Value = "12" Then
    ActiveCell.Value = "Preventative Maintenance"
    End If
    If ActiveCell.Value = "13" Then
    ActiveCell.Value = "Waste Toner"
    End If
    If ActiveCell.Value = "14" Then
    ActiveCell.Value = "Training"
    End If
    If ActiveCell.Value = "15" Then
    ActiveCell.Value = "Meter Reads"
    End If
    If ActiveCell.Value = "16" Then
    ActiveCell.Value = "Walk-through"
    End If
    If ActiveCell.Value = "17" Then
    ActiveCell.Value = "Data Correction"
    End If
    If ActiveCell.Value = "18" Then
    ActiveCell.Value = "Other"
    End If

    End Sub
    [\code]

    Eternally grateful, Monika
    Last edited by monikahartley001; 12-27-2017 at 12:13 PM. Reason: Post against rule 3

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,225

    Re: rangeArray(i).Select Error

    Hi Monica
    Welcome to the Forum
    In future please view the forum rules before posting. Your post does not comply with rule #3.
    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the [#] button at the top of the post window.
    Unfortunately we are unable to assist until this has been rectified. Go to first post and edit as per above.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Getting compile error 'end select without select case'
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-22-2014, 01:57 AM
  2. [SOLVED] Error: End Select without Select Case
    By RGrunden in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2012, 02:34 PM
  3. Select statement producing an error "Select method of worksheet failed"
    By jeskit in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-10-2011, 11:50 AM
  4. [SOLVED] Range.Select error and screen maximizing error in Workbook_Open()
    By Punsterr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-10-2006, 05:20 PM
  5. [SOLVED] Range.Select error and screen maximizing error in Workbook_Open()
    By Punsterr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2006, 03:00 PM
  6. Why Error Message "End Select without Select Case"?
    By GoFigure in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-08-2005, 08:30 PM
  7. [SOLVED] Help with this error Unknown reason for error with Range().Select
    By Brad Sumner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-13-2005, 12:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1