Results 1 to 3 of 3

error 2023

This is a discussion on error 2023 within the Excel Questions forums, part of the Question Forums category; when i'm running the following macro i get error 2023 what does that mean and more importantly how do i ...

  1. #1
    New Member
    Join Date
    Aug 2006
    Posts
    4

    Default error 2023

    when i'm running the following macro i get error 2023 what does that mean and more importantly how do i fix it.

    macro:
    Code:
    
    Sub OneColumnRemoveBlanks()
    Dim MyColumn As Long, c As Range, i As Integer
    
    
    MyColumn = Selection.Column
    i = 0
    For Each c In Selection
        If Len(c) > 0 Then
            Cells(c.Row - i, c.Column + 1) = c.Value
        Else
            i = i + 1
        End If
    Next c
    
    
    End Sub
    the line
    If Len(c) > 0 Then
    gives the error according to visual basics.

    if someone could help me with this and explain it in simple language (i can just only read macro and understand them, even this one i haven't made myself) i would be very gratefull.[/quote]

  2. #2
    New Member
    Join Date
    Aug 2006
    Posts
    4

    Default

    if have been trying various things today and i noticed that the same macro still works in an older version of my spreadsheet could anyone help me on how this could be solved i'll put.

    the following macro is excecuting the previous macro.
    the first is done correctly but somewhere between the first and the fourth it goes wrong.

    Code:
    Sub CreateItemValidation()
    '
    ' CreateItemValidation Macro
    ' Macro recorded 5-8-2005 by Danny Batenburg
    '
    
    '
        Sheets("Equiped Items").Select
        Union(Range( _
            "FL:FL,FN:FN,FP:FP,FR:FR,FT:FT,FV:FV,FX:FX,FZ:FZ,GB:GB,GD:GD,GF:GF,GH:GH,GJ:GJ,GL:GL,GN:GN,GP:GP,DN:DN,DB:DB,DD:DD,DF:DF,DH:DH,DJ:DJ,DL:DL,DN:DN,DP:DP,DR:DR,DT:DT,DV:DV,DX:DX,DZ:DZ,EB:EB,ED:ED" _
            ), Range( _
            "EF:EF,EH:EH,EJ:EJ,EL:EL,EN:EN,EP:EP,ER:ER,ET:ET,EV:EV,EX:EX,EZ:EZ,FB:FB,FD:FD,FF:FF,FH:FH,FJ:FJ" _
            )).Select
        Selection.ClearContents
        Range("'Equiped Items'!DA2:DA2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!DC2:DC2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!DE2:DE2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!DG2:DG2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!DI2:DI2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!DK2:DK2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!DM2:DM2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!DO2:DO2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!DQ2:DQ2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!DS2:DS2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!DU2:DU2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!DW2:DW2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!DY2:DY2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!EA2:EA2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!EC2:EC2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!EE2:EE2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!EG2:EG2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!EI2:EI2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!EK2:EK2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!EM2:EM2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!EO2:EO2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!EQ2:EQ2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!ES2:ES2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!EU2:EU2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!EW2:EW2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!EY2:EY2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FA2:FA2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FC2:FC2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FE2:FE2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FG2:FG2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FI2:FI2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FK2:FK2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FM2:FM2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FO2:FO2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FQ2:FQ2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FS2:FS2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FU2:FU2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FW2:FW2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!FY2:FY2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!GA2:GA2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!GC2:GC2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!GE2:GE2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!GG2:GG2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!GI2:GI2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!GK2:GK2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!GM2:GM2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!GO2:GO2000").Select
        Application.Run _
            "'Kopie van Kopie van Kansloos Sheet.xls'!OneColumnRemoveBlanks"
        Range("'Equiped Items'!D2:D2").Select
        Range("'Equiped Items'!B2:B2").Select
        
    
    End Sub
    hopefully this helps to get a solution

  3. #3
    New Member
    Join Date
    Aug 2006
    Posts
    4

    Default problem solved

    the problem is solved there was a reference error in the selected area's

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com