Notifications
Clear all
VBA & Macros
2
Posts
2
Users
0
Reactions
224
Views
Topic starter
Hi All, how do i get the variable c address in my variable rng
dim r as range, c as string
c = Activecell.Entirecolumn.Address (False,False)
rng = Intersect(Range("C"),Activesheet.usedrange
It is throwing an error for variable rng
Posted : 21/10/2018 9:20 am
Hi Ravikiran
Not quite sure what you mean but there are a few things you need to change
You've declared r as as range but you are using rng
You also need to Set a range variable
And are you trying to get the intersection of the range described by c and ActiveSheet.UsedRange?
Try this
Sub MyRanges()
Dim rng As Range, c As String
c = ActiveCell.EntireColumn.Address(False, False)
Set rng = Intersect(Range(c), ActiveSheet.UsedRange)
End Sub
Regards
Phil
Posted : 22/10/2018 12:26 am