IF a value in one column is => 10,000, Yes in next column or no in next column if false

OilEconomist

Active Member
Joined
Dec 26, 2016
Messages
422
Office Version
  1. 2019
Platform
  1. Windows
Thanks in advance, and I will let you know what final result works.

Objective: Within the same sheet if column J entry >= 10,000, Then Column K = "Yes", Else Column K = "No". The number of rows in the worksheet will vary when I use this sheet so I want to make it find the last row.

Sub Value()

Worksheets("Sheet1").Activate
Dim LastRow1000 As Long
LastRow1000 = ThisWorkbook.Worksheets("Shee1").Cells(Rows.Count, 1).End(xlUp).Row

erow = Worksheets("Sheet1").Columns.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

For i = 2 To LastRow1000
If Worksheets("Sheet1").Columns.Cells(erow, 10) >= 10000 Then
Worksheets("Sheet1").Columns.Cells(erow, 11) = "Yes"
Else
Worksheets("Sheet1").Columns.Cells(erow, 11) = "No"
End If
Next i

End Sub
 
FDibbins, as I indicated that I am trying to automate my model. I have to download this sheet (not data) every month and the number of rows changes. I prefer to import this into my model and click a button. The macro does several other things so I wanted to this versus a formula. Also, when you start to have too many formulas or ranges become long, MS Excel starts giving problems and when you are editing.

I could copy the data from the sheet and paste it into the model where the formulas are already set, but versus mixing with formulas and macros, I prefer to go one way.
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,215,461
Messages
6,124,952
Members
449,198
Latest member
MhammadishaqKhan

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