Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

Match list name of header and find blanks cell in row

$
0
0
hi,

i need to match Column 1 by the list of name in header, as it is not fixed header names every page ,so need to find by Selected name and need to search for blanks cell in row and paste the blanks header name in remarks row for each column till the end of page
need to put comma after each header name and remove last comma . if find single blank cell add ( is Not Available ),if more add ( are Not Available ) in remarks cell ends of words. NEED VB OR MACRO . all in upper case .


need to search the header name for A1 TO AL1 and look for blanks cell in the row and take in remarks


Service Point No
Source No. (11 Digit )
Mobile / Landline No
Phase (R/Y/B)
Meter Sl. No
Meter Model
Meter Mfg. Year
Current Rating ()Amp)
No of Floors
Meter Floor No

current used vb code ,it take all header and put blanks header name in remarks
Sub orbital()
Dim sh As Worksheet, lr As Long, lc As Long, rng As Range, c As Range, i As Long
Dim strVal As String, ph As String
Set sh = Sheets(1) 'Edit sheet name
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To lr
Set rng = sh.Range("A" & i, "L" & i)
X = 0
For Each c In rng
If c = "" Then
strVal = sh.Cells(1, c.Column).Value & ", " & strVal
X = X + 1
End If
Next
If X = 1 Then
ph = " is not available."
ElseIf X > 1 Then
ph = " are not available."
Else
GoTo SKIP:
End If
sh.Range("M" & i) = strVal & ph
strVal = Empty
ph = Empty
SKIP:
Next
End Sub

Viewing all articles
Browse latest Browse all 42215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>