AND Formula in Macro VBA

Status
Not open for further replies.

NYEXCEL1

Board Regular
Joined
Apr 17, 2013
Messages
123
In the below Macro, specifically the section in red, i am trying to and an AND formula but do not know how.

In short, when the value is evaluated and it matches the "" "" format as shown, i need add a condition that say if the number in the cell with the offset of -5 of the row is 5080 then print word "NOTHING" otherwise "NONEED".

I thought maybe eliminating the first if statement (in red) and adding separate if statement just for this double condition would be easier but it didnt work. Really appreciate any help in getting this to work. Many thanks!!


Any help here would be great and if i am overthinking this


Sub Nyexcel2()
With Range("I4", Range("B" & Rows.Count).End(xlUp).Offset(, 7))
.Value = Evaluate(Replace("if((@ ="" ""),""NONEED"",if((@ =""""),"""",2010))", "@", .Offset(, -7).Address))
End With
End Sub
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
The first criterion is looking for a single space (i.e. " ") in column B. Is that what you want?
 
Upvote 0
Yes, then in Column D there is a 4 digital code. if the number is 5080 then print "NOTHING" otherwise "NONEED"

thanks
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,223,884
Messages
6,175,174
Members
452,615
Latest member
bogeys2birdies

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