Junoon
05-12-2012, 04:55 PM
Hi,
i have made global string constants for ranges.
Global Const G_Cl As String = "G2:G13"
Global Const G_Vl As String = "I2:I13"
Global Const G_VlS As String = "L2:L13"
i want to clear these ranges using a single line of code.
With wkData
.Range(G_Cl, G_Vl, G_VlS).ClearContents
End With
but i get error:
"Wrong no of arguments or invalid property assignment!"
i even tried this:
With wkData
.Range(Array(G_Cl, G_Vl, G_VlS)).ClearContents
End With
OR
With wkData
.Range([{G_Cl, G_Vl, G_VlS}]).ClearContents
End With
how can i clear all the ranges in one line of code?
i have made global string constants for ranges.
Global Const G_Cl As String = "G2:G13"
Global Const G_Vl As String = "I2:I13"
Global Const G_VlS As String = "L2:L13"
i want to clear these ranges using a single line of code.
With wkData
.Range(G_Cl, G_Vl, G_VlS).ClearContents
End With
but i get error:
"Wrong no of arguments or invalid property assignment!"
i even tried this:
With wkData
.Range(Array(G_Cl, G_Vl, G_VlS)).ClearContents
End With
OR
With wkData
.Range([{G_Cl, G_Vl, G_VlS}]).ClearContents
End With
how can i clear all the ranges in one line of code?