Created
June 11, 2017 08:09
-
-
Save harsha547/ccf8ef102e240db9b29d556e2e4dbec0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub columndelete() | |
Dim lrow As Long | |
Dim lcolumn As Long | |
lcolumn = Sheet1.Range("A4").CurrentRegion.Columns.Count | |
lrow = Sheet2.Range("f1").CurrentRegion.Rows.Count | |
For j = 1 To lrow | |
For i = 1 To lcolumn | |
If Sheet1.Cells(4, i).Value = Sheet2.Cells(j, 5).Value Then | |
Sheet1.Columns(i).Delete | |
End If | |
Next i | |
Next j | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment