Thank u for your reply.
I am sending my code for your reference so that you can tell the exac
solution
this macro is to copy the data from two columns and paste it is colum
"O" and hide all rows which are not having data (CHECK COLUM "O".
Sub HideRows()
Dim rgHide As Range, rw As Range
Dim RST As String ' Reset value
Dim OP As Integer 'Output value
Dim RST_COL
Dim OP_COL
'--------------- FOR unchideing all the rows
Range("A1:A200").Select
Selection.EntireRow.Hidden = False
'--------------------------
RST_COL = Range("AW5").Cells.Value 'take i/p values for reset
OP_COL = Range("AW8").Cells.Value 'take i/p value for o/p
''''''''''''''''''''''''''''''''''
''''''''''''''''''''''
'CLEAR CELLS
Dim i
For i = 4 To No_Row
If (Not Cells(i, 15).Value) Then
Cells(i, 15).Value = ""
End If
'Cells(i, 1).Value = ""
Next i
''''''''''''''''
'copy data from reset to G
For i = 4 To No_Row
If Not Cells(i, RST_COL).Value Then
Cells(i, 15).Value = Cells(i, RST_COL).Value
End If
'Cells(i, 1).Value = ""
Next i
'copy data from O/P to G
For i = 4 To No_Row
If (Cells(i, 15).Value = "") And (Not Cells(i, OP_COL).Value) Then
Cells(i, 15).Value = Cells(i, OP_COL).Value
End If
'Cells(i, 1).Value = ""
Next i
'HIDE CELLS
For Each rw In Range("O4:O200").Rows
If Application.CountA(rw) = 0 Then
If rgHide Is Nothing Then
Set rgHide = rw
Else
Set rgHide = Union(rgHide, rw)
End If
End If
Next rw
If Not rgHide Is Nothing Then rgHide.EntireRow.Hidden = True
End Su