Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Length of Used Column
Can anyone tell me why the following sometimes works,
depending on cell contents. Range("A6").Value = Range(Range("C1").End(xlDown)).Row For a used range, eg "C1:C36" I want to put the values 1 to 36 in the range "B1:B36" automatically, for this I need to find the last used cell, eg "C36". The range length varies, hence the use of the above function. Thanks Alec |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Length of Used Column
That never works because the syntax is incorrect
Sub Tester9() h = Range("C65536").End(xlUp).Row Range("B1") = 1 Range("B2") = 2 Range("B1:B2").AutoFill _ Destination:=Range("B1:B" & h), _ Type:=xlFillDefault End Sub -- Regards, Tom Ogilvy "Alec" wrote in message ... Can anyone tell me why the following sometimes works, depending on cell contents. Range("A6").Value = Range(Range("C1").End(xlDown)).Row For a used range, eg "C1:C36" I want to put the values 1 to 36 in the range "B1:B36" automatically, for this I need to find the last used cell, eg "C36". The range length varies, hence the use of the above function. Thanks Alec |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Length of Used Column
Thanks Tom
That routine works great. -----Original Message----- That never works because the syntax is incorrect Sub Tester9() h = Range("C65536").End(xlUp).Row Range("B1") = 1 Range("B2") = 2 Range("B1:B2").AutoFill _ Destination:=Range("B1:B" & h), _ Type:=xlFillDefault End Sub -- Regards, Tom Ogilvy "Alec" wrote in message ... Can anyone tell me why the following sometimes works, depending on cell contents. Range("A6").Value = Range(Range("C1").End(xlDown)).Row For a used range, eg "C1:C36" I want to put the values 1 to 36 in the range "B1:B36" automatically, for this I need to find the last used cell, eg "C36". The range length varies, hence the use of the above function. Thanks Alec . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to have charac in new column with 40 char length only... | Excel Discussion (Misc queries) | |||
Text to column fixed length | Excel Discussion (Misc queries) | |||
automate column length | Excel Discussion (Misc queries) | |||
Sum a Column of Variable length | Excel Discussion (Misc queries) | |||
Sum a column of variable length? | Excel Discussion (Misc queries) |