Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Problem?
I need to activate a range using some variables - like so:
range("("f" & c.row):("f" & tendr)").Activate I've tried every combination I can think of, over and over again, but nothing I can come up with will work. Can someone help me, please? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Problem?
This works. You should be able to figure it out from this. Lose the colon.
Sub animals() frog = "B" cow = "1" horse = "C" sheep = 6 Range((frog & cow), (horse & sheep)).Select End Sub -- Allllen "Ed" wrote: I need to activate a range using some variables - like so: range("("f" & c.row):("f" & tendr)").Activate I've tried every combination I can think of, over and over again, but nothing I can come up with will work. Can someone help me, please? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Problem?
Put everything inside a string. In your example, the quotes and
parenthesis are all out of place, and you aren't putting the colon within the string. For example, using your example, try this: dim r as string r = "f" + cstr (c.row) + ":" + "f" + cstr (tendr) call activesheet.range (r).select Hope this helps, Dom Ed wrote: I need to activate a range using some variables - like so: range("("f" & c.row):("f" & tendr)").Activate I've tried every combination I can think of, over and over again, but nothing I can come up with will work. Can someone help me, please? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Problem?
One mo
range(cells(c.row,"F"),cells(tendr,"F")).activate Ed wrote: I need to activate a range using some variables - like so: range("("f" & c.row):("f" & tendr)").Activate I've tried every combination I can think of, over and over again, but nothing I can come up with will work. Can someone help me, please? -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Problem?
Thanks, Dom for your help. Works great. I really struggled with it before
posting. wrote in message oups.com... Put everything inside a string. In your example, the quotes and parenthesis are all out of place, and you aren't putting the colon within the string. For example, using your example, try this: dim r as string r = "f" + cstr (c.row) + ":" + "f" + cstr (tendr) call activesheet.range (r).select Hope this helps, Dom Ed wrote: I need to activate a range using some variables - like so: range("("f" & c.row):("f" & tendr)").Activate I've tried every combination I can think of, over and over again, but nothing I can come up with will work. Can someone help me, please? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Problem?
This is one of the cool things about newsgroups. I never knew that the
following would work: 1. range ("A1", "C1") -- I thought the colon was needed. 2. range (cells (1, "A"), cells(2, "A") -- I thought CELLS needed long arguments. Dom Ed wrote: I need to activate a range using some variables - like so: range("("f" & c.row):("f" & tendr)").Activate I've tried every combination I can think of, over and over again, but nothing I can come up with will work. Can someone help me, please? |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Problem?
#2. Nope. Excel/VBA will work nicely with longs or strings in that column
field. Range("a1:C1") would need the colon. " wrote: This is one of the cool things about newsgroups. I never knew that the following would work: 1. range ("A1", "C1") -- I thought the colon was needed. 2. range (cells (1, "A"), cells(2, "A") -- I thought CELLS needed long arguments. Dom Ed wrote: I need to activate a range using some variables - like so: range("("f" & c.row):("f" & tendr)").Activate I've tried every combination I can think of, over and over again, but nothing I can come up with will work. Can someone help me, please? -- Dave Peterson |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Problem?
My thanks to Dave also. Newsgroups are great - nearly always learn something
new after I post. "Dave Peterson" wrote in message ... #2. Nope. Excel/VBA will work nicely with longs or strings in that column field. Range("a1:C1") would need the colon. " wrote: This is one of the cool things about newsgroups. I never knew that the following would work: 1. range ("A1", "C1") -- I thought the colon was needed. 2. range (cells (1, "A"), cells(2, "A") -- I thought CELLS needed long arguments. Dom Ed wrote: I need to activate a range using some variables - like so: range("("f" & c.row):("f" & tendr)").Activate I've tried every combination I can think of, over and over again, but nothing I can come up with will work. Can someone help me, please? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Simple IF problem | Excel Worksheet Functions | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Simple IF problem | Excel Discussion (Misc queries) | |||
another simple problem... | Excel Worksheet Functions | |||
Simple VBA problem | Excel Programming |