Hi all of u,
With the help of this forum I am able to accomplish many tasks.Currently I am looking two things in vba code.
1.In column Q I have used the formula, the same I want to use thru VBA.
2.If any of the data is present in column K: P then Column Q data should be visible else data will be invisible,say suppose the fonts will get converted into white background if neither of the cell contains data in each row from column K to P.This I require in VBA.
I have recd the vba code in one of the forum(http://www.excelforum.com/showthread.php?t=1085777&p=4090024) but it is displaying the formula it should however be shown as value form and other values in hidden form.
Hope anyone can resolve it .
With the help of this forum I am able to accomplish many tasks.Currently I am looking two things in vba code.
1.In column Q I have used the formula, the same I want to use thru VBA.
2.If any of the data is present in column K: P then Column Q data should be visible else data will be invisible,say suppose the fonts will get converted into white background if neither of the cell contains data in each row from column K to P.This I require in VBA.
I have recd the vba code in one of the forum(http://www.excelforum.com/showthread.php?t=1085777&p=4090024) but it is displaying the formula it should however be shown as value form and other values in hidden form.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
t = Target.Address
If InStr(t, ":") > 0 Then
'MultiCell
MyArray = Split(t, ":")
ColA = Range(MyArray(0)).Column
ColB = Range(MyArray(1)).Column
RowA = Range(MyArray(0)).Row
RowB = Range(MyArray(1)).Row
If ColA < 11 Or ColB > 16 Or RowA < 4 Then Exit Sub
For RowCount = RowA To RowB
For Count = 11 To 16
temp = temp & Cells(RowCount, Count).Value
Next
If temp = "" Then
Cells(RowCount, 17).Clear
Else
Cells(RowCount, 17).FormulaR1C1 = "=RC[-16]&""-""&COUNTIF(R4C1:RC[-16],RC[-16])"
End If
Next
Else
If Target.Rows.Count > 1 Or Target.Column < 11 Or Target.Column > 16 Or Target.Row < 4 Then Exit Sub
For Count = 11 To 16
temp = temp & Cells(Target.Row, Count).Value
Next
If temp = "" Then
Cells(Target.Row, 17).Clear
Else
Cells(Target.Row, 17).FormulaR1C1 = "=RC[-16]&""-""&COUNTIF(R4C1:RC[-16],RC[-16])"
End If
End If
End Sub
Hope anyone can resolve it .
Last edited by a moderator: