I must be missing something

Araziel

New Member
Joined
Mar 21, 2011
Messages
2
I have been working on this for over 2 hours but still can't get it to see that the value in B23 is greater then 0 help what am I missing??? :confused:

Sub RVTR2()

Sheets("x").Select
If B23 > 0 Then

Sheets("y").Select
Selection.AutoFilter Field:=4, Criteria1:=">0", Operator:=xlAnd
Range("C3:I3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Open Filename:= _
"xy"
Range("C3").Select
Selection.Insert Shift:=xlDown
Range("C3").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("C3").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
ActiveWindow.Close
Selection.AutoFilter Field:=4
Sheets("y").Select
Range("A18").Select

End If

Sheets("y").Select
Range("C3:I3").Select
Selection.Copy
Workbooks.Open Filename:= _
"xy"
Range("C3").Select
Selection.Insert
Range("C3").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("C3").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
ActiveWindow.Close
Selection.AutoFilter Field:=4
Sheets("y").Select
Range("A18").Select
End Sub
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Code:
If Range("B23").Value > 0 Then

If you put Option Explicit at the top of every module, the VBE would tell you that B23 is an undeclared variable, which tells you something is amiss.
 
Upvote 0
OMG I must be way to tired to have missed that.

Thanks you saved me from pulling out all my hair over something sooo simple.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

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