Assign Cell Address To Variable . .

Evagrius Ponticus

Well-known Member
Joined
May 24, 2007
Messages
1,467
Hi all,

I've tried a number of ways to solve this but I keep getting an error. I declared MyLoc as range. I keep getting an error in "MyLoc = activecell.address". How do I assign the range of the active cell to a variable so I can use that variable as a range?? Thanks for any help.


Code:
    Do Until ActiveCell.Value = Me.TextBox1.Value
    ActiveCell.Offset(1, 0).Activate
    Loop
    MyUser = ActiveCell.Offset(0, -1)
    MyUserNum = ActiveCell.Offset(0, -2)
    MyLoc = ActiveCell.Address

'AUTOFILL BASED ON MyUser
    MyActive.Range("T2").AutoFilter Field:=20, _
    Criteria1:=MyLoc.Offset(0, 1).Value & "." & _
    MyLoc.Offset(0, 2) & "@yahoo.com"
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Not quite sure what you are trying to do exactly but:
Code:
Dim MyLoc As Range
Set MyLoc = ActiveCell
 
Upvote 0
Thanks HotPepper - that worked - I guess I should have known that since I already declared MyLoc as range then I didn't need to add the .address . . .thanks . .
 
Upvote 0

Forum statistics

Threads
1,214,667
Messages
6,120,818
Members
448,990
Latest member
rohitsomani

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top