Issues with greater than in my code

juxion

New Member
Joined
Mar 3, 2021
Messages
6
Office Version
  1. 2016
Platform
  1. Windows
Hey there

I have made a smaller system. Where you can fill in two columns and then you have to click on a save button and then it will make a note based on this.

In column 3 "code" there will always be the number 0 and in column 5 "input note" you can enter note.

I have made a code that if it says something in columns 3 and 5 then it must save the note.

But because it says 0 in column 3, it will still save. But it should only save if the number is greater than 0 can you help?

VBA Code:
'''''''''''''' IF EITHER STATUS COLUMN C OR NOTE COLUMN E CONTAINS DATA, RUN THE SCRIPT

If .Cells(x, 3) <> "" Or .Cells(x, 5) <> "" Then
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Try
VBA Code:
If .Cells(x, 3) <> 0 Or .Cells(x, 5) <> "" Then
Or
VBA Code:
If .Cells(x, 3) > 0 Or .Cells(x, 5) <> "" Then
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,543
Members
449,316
Latest member
sravya

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