Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Example: Generating a Range String from numbers.
This is a coding example of how to make a range string from numbers.
Function RangeString(Row1, Col1, Row2, Col2) ' Return Range String from Arguments. ' No checking for reversed range specs. RangeString = Nr2Col(Col1) & Row1 & ":" & Nr2Col(Col2) & Row2 End Function Function Nr2Col(NR) ' Turn NR into Excel Column Designator. If NR <= 26 Then Nr2Col = Chr(64 + NR) Else Nr1 = Chr(64 + Int(NR / 26)) Nr2 = Chr(65 + NR Mod 26) Nr2Col = Nr1 & Nr2 End If End Function RangeString(1,1,2,5) returns "A1:E2". Let me know if you find this helpful. Thanks Mac@ SV-CaliforniaGirl.Com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
RANDBETWEEN generating numbers outside range | Excel Worksheet Functions | |||
Generating random numbers | Excel Worksheet Functions | |||
Generating a random 17-character alphanumeric string | Excel Discussion (Misc queries) | |||
create self-generating numbers with letters and numbers | Excel Discussion (Misc queries) | |||
Convert String of 512 numbers to a range | Excel Programming |