How to repeat the macro for all cells in a column with reference to the adjacent column cell is not empty

raghavanhr

New Member
Joined
Aug 29, 2018
Messages
3
Dear Friend,

Please help me to run the macro for all cells of a particular column, with reference to the adjacent cell till it is not an empty cell.

eg. column I refers to the cell value to execute the Macro in column J.

If the cell value of I =0, J value should be as "Can issue" else "Material Return Pending"

I have written the macro as below


"Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Range("I2").Value = 0 Then
Range("J2").Value = "Can Issue"
Else
Range("J2").Value = "Maretial Retun Pending"
End If
End Sub
"

I don't know how to attach my excel sample file.

pasted below the values of my excel

SR.NODATEID NO.PART. IDDESCRIPTIONUOMISSUE QTYRETURN QTYNEW ISSUEMaterial Issuance CheckSHIFTPROJECTREMARKS
102/02/201980181000000499EAR PLUGNOS110Can IssueDAYJF1801
202/02/2019135381000000499EAR PLUGNOS110DAYJF1801
302/02/2019168482100000040WHITE MARKERNOS101DAYJF1801
402/02/201989481000000219TWECO CONNECTOR 120MM MALENOS202DAYJF1801
502/02/201989481000000219TWECO CONNECTOR 120MM FEMALENOS202DAYJF1801
602/02/201995276020000007DOTTED GLOVESPAIR110DAYJF1801
702/02/201995281000000499EAR PLUGNOS110DAYJF1801
802/02/201995281000000529GRINDING DISC 7''NOS110DAYJF1801

<tbody>
</tbody>
 

Some videos you may like

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,471
Have you considered a formula in Cell J2 (and Copied Down) like - Macro Not Needed!!
Code:
[TABLE="width: 173"]
<tbody>[TR]
[TD="class: xl63, width: 173"]=IF(I2=0,"Can  Issue","Material Retun Pending")[/TD]
[/TR]
</tbody>[/TABLE]
 

raghavanhr

New Member
Joined
Aug 29, 2018
Messages
3
Hi Jim,

I want that J2 column with a comment to be blinking if it is Material Return Pending, else the store guy can issue the material. This is to enhance my material issuance track.

kindly advise.
thanks,
Vijay.
 

raghavanhr

New Member
Joined
Aug 29, 2018
Messages
3
I don't have any formula in J2, but with reference to the value in "I" column, called the comment in J column by a macro.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,924
Messages
5,525,654
Members
409,658
Latest member
Yardcell

This Week's Hot Topics

Top