|
-
Oct 6th, 2000, 11:33 AM
#1
Thread Starter
Member
I don't have the help file on my machine, and it's been awhile since I've done this. How do I set the range property?
For example
Dim MyRange as Range
MyRange = Activecell.range
This doesn't work because it wants more parameters for the range property.
I also tried Range(activecell), but that didn't work either.
Thanks,
LauRa
LauRa
"Work like you don't need the money...Love like you've never been hurt...Dance like nobody is watching..."
-
Oct 6th, 2000, 11:37 AM
#2
Hyperactive Member
Hi,
You could try, MyRange = ActiveWindow.Selection
Hope this helps!
-
Oct 6th, 2000, 11:39 AM
#3
Thread Starter
Member
That didn't work, but thanks anyway. It appears that the selection property actually takes the value of the cell instead of the range.
LauRa
LauRa
"Work like you don't need the money...Love like you've never been hurt...Dance like nobody is watching..."
-
Oct 6th, 2000, 11:46 AM
#4
Hyperactive Member
Try something like this:
MyRange = range("A1:C1")
-
Oct 6th, 2000, 11:49 AM
#5
Thread Starter
Member
I need it to be a little more general.
LauRa
"Work like you don't need the money...Love like you've never been hurt...Dance like nobody is watching..."
-
Oct 6th, 2000, 12:29 PM
#6
Hyperactive Member
You can pass variable to the range something like this:
dim myvar as variant
myvar = activecell.formulaR1C1
MyRange = range(myvar)
-
Oct 6th, 2000, 01:53 PM
#7
Thread Starter
Member
I keep getting an error "Object variable or With block variable not set". Should I be more flexible with my variable definitions?
Sub Test()
Dim myRange As Range
Dim urRange As Range
Range("A2").Select
myRange.FormulaR1C1 = ActiveCell.FormulaR1C1
urRange = Range("myrange")
End Sub
LauRa
LauRa
"Work like you don't need the money...Love like you've never been hurt...Dance like nobody is watching..."
-
Oct 6th, 2000, 02:20 PM
#8
Thread Starter
Member
Thanks for the help. I finally got it to work. Here's the code in case anyone's interested:
MFCount & SFCount are Integers set earlier in the code
If SFUPC = MFUPC Then
Windows("Final_Multi_Family.xls").Activate
tempRange = "I" & MFCount
Range(tempRange).Activate
Desc = ActiveCell.Offset(0, 1).Text
Windows("Final_SingleFamily.xls").Activate
tempRange = "J" & SFCount
Range(tempRange).Activate
ActiveCell.Value = Desc
ElseIf SFUPC < MFUPC Then
Else
End If
LauRa
"Work like you don't need the money...Love like you've never been hurt...Dance like nobody is watching..."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|