Repair of the Code, more than one OR IF also add the code.

Muttaki

New Member
Joined
Mar 16, 2011
Messages
6
Hi frends ,

Title may have been a little strange, but the code of an application already written with the help of my friends need a revision. Thank you in advance about the possibilities of this help. Let us come to our, the following code, if any value in column J of "0" ZERO in the "Empty warehouse" he writes in the value of the cell. But this time, this code connect to the "Volume Control" button in the functionality, in other words, I want to improve the quality. ALSO I need to add the column of control in column J in the control of the situation require that I use the connector for OR expression with another expression. At the same time in the column I want to use the IF statement. "I" column of the small number of digits in column J and J at the same cell, delete a small number "Stock Quantity Insufficient + Value" write

For Example ;

Orginal DATA===================================

Column I ColumnJ
Amount Deposit Amount
--------- --------------


7654 6895
1425 1425
3000 2950
23 0

=============================================

I want a result

Column I ColumnJ
Amount Deposit Amount
------ --------------

7654 Stock Quantity Insufficient 6895
1425 1425
3000 Stock Quantity Insufficient 2950
23 Empty warehouse

==============================================

Code:
Private Sub CommandButton4_Click()
Dim Say As Byte, bul As Range
Say = Range("J108").End(3).Row
Set kontrol = Range("J9:J" & Say).Find("ELDE STOK YOK --English ;Empty warehouse ", , , 1)
If Not kontrol Is Nothing Then
MsgBox "DAHA ÖNCE MİKTAR KONTROLÜ YAPILMIŞ --English ; Previously made little control. ", 64, "Uyarı Mesajı"
Exit Sub
End If
If WorksheetFunction.CountIf(Range("J9:J" & Say), 0) = 0 Then MsgBox "MİKTAR HATASI YOK,DEPODAKİ TÜM MİKTARLAR YETERLİ": Exit Sub
  For Each bul In Range("J9:J" & Say)
    If CStr(bul.Value) = CStr(0) Then
       bul.Value = "Elde Stok Yok"
       bul.Font.ColorIndex = 3
       bul.Font.Bold = True
       bul.Offset(0, -1).Font.ColorIndex = 2
       bul.Offset(0, -1).Font.Bold = True
           
       bul.Offset(0, -2).Font.ColorIndex = 2
       bul.Offset(0, -2).Font.Bold = True
       
       bul.Offset(0, -3).Font.ColorIndex = 2
       bul.Offset(0, -3).Font.Bold = True
       bul.Offset(0, -4).Font.ColorIndex = 2
       bul.Offset(0, -4).Font.Bold = True
       bul.Offset(0, 1).Font.ColorIndex = 2
       
       
       bul.Offset(0, 2).Font.ColorIndex = 2
       bul.Offset(0, 2).Font.Bold = True
       
       bul.Offset(0, 3).Font.ColorIndex = 2
       bul.Offset(0, 3).Font.Bold = True
       
       bul.Offset(0, 4).Font.ColorIndex = 2
       bul.Offset(0, 4).Font.Bold = True
       bul.Offset(0, 4).Value = 0
       bul.Offset(0, 5).Font.ColorIndex = 2
       bul.Offset(0, 5).Font.Bold = True
       bul.Offset(0, 5).Value = 0
       bul.Offset(0, 6).Font.ColorIndex = 2
       bul.Offset(0, 6).Font.Bold = True
       bul.Offset(0, 6).Value = 0
       bul.Offset(0, 7).Font.ColorIndex = 2
       bul.Offset(0, 7).Font.Bold = True
       bul.Offset(0, 7).Value = 0
       bul.Offset(0, 8).Font.ColorIndex = 2
       bul.Offset(0, 8).Font.Bold = True
       bul.Offset(0, 8).Value = 0
       bul.Offset(0, 9).Font.ColorIndex = 2
       bul.Offset(0, 9).Font.Bold = True
       bul.Offset(0, 9).Value = 0
      
       
       Range(bul.Offset(0, -9).Address(False, False) & ":" & bul.Offset(0, 9).Address(False, False)).Interior.ColorIndex = 1
        
       'Else
        'MsgBox "MİKTAR HATASI YOK !"
        
       End If
      
       
       Next bul
       
                      
End Sub[Code/]







Thank you, your trust in Allah.
 
Last edited:

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,223,625
Messages
6,173,395
Members
452,514
Latest member
cjkelly15

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