not working at all

edluver216

New Member
Joined
Jun 19, 2008
Messages
7
Code:
Sub ReCommentOnUs()
    Dim OnUs As Range
    Dim ActiveList As Range, Active As Range
    Set OnUs = Worksheets("Break-Down").Columns(5)
        
    With Application
        .Calculation = xlCalculationManual
        .ScreenUpdating = True
    End With
    
    'Fill ActiveList Array
    With Sheets("Full Report")
        Set ActiveList = Range("C2:C" & Cells(Rows.Count, "C").End(xlUp).Row)
    End With
    For Each Active In ActiveList
        If Application.CountIf(OnUs, Active) > 0 Then
            If Active.Offset(0, -2).Value = Null Then
                Active.Offset(0, -2).Value = "On Us Check"
            ElseIf Active.Offset(0, -2).Value <> Null Then
                Active.Offset(0, -2).Select
                Selection.Cut
                Active.Offset(0, 73).Select
                ActiveSheet.Paste
                Active.Offset(0, -2).Select
                Selection.Value = "On Us Check"
            End If
        End If
    Next
    
    With Application
        .Calculation = xlCalculationAutomatic
        .ScreenUpdating = False
    End With
    
End Sub

The object of this code is to compare one column of numbers to another, if there is a match, the cell in the A column is tested. If it returns NULL, the comments "On Us Check" is to be added, if the cell already contains a value, that value will be cut and moved to column BX of the same row and then "On Us Check" is added to the cell in Column A. this isnt working at all, can anyone help?:confused::confused::confused:
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Before I even look closer...

Are you sure?
ie.
Code:
With Application
        .Calculation = xlCalculationAutomatic
        .ScreenUpdating = False
    End With
    
End Sub

You are turning OFF Screen updating just before you finish the Macro. This could cause all sorts of trouble - unless you are turning it on again somewhere else....
 
Upvote 0
Change Null to ""
Code:
If Active.Offset(0, -2).Value = "" Then
 
ElseIf Active.Offset(0, -2).Value <> "" Then
 
Upvote 0
I am turning it back on later, i leave it off as default to watch code i'm not comfortable with. any suggestions on how i can get this to work, it still isnt.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top