Setting a Range name

T

Tempy

Good Day, I have to name a range and it can vary, dependant on the
spreadsheet recieved and the amount od data but all the used area will
be the range name KTL.

At this point in time it is A1:CQ847

This could go to CQ5000

Could somebody help me with some code please.

Thanks in advance

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
 
B

Bob Phillips

set myRange = Range("A1:C" & cells(rows.count,"C").end(xlup).row)

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
T

Tom Ogilvy

You mean like Insert=>Name=>Define kind of name a range?

ActiveSheet.UsedRange = "KTL"
 
T

Tempy

Thanks Bob, but i need to test the range and then name it as KTL, as the
range is not fixed but varying.

I tried this but it name it from A1:C847, but the width or number of
columns can also vary.

Thanks

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
 
T

Tempy

Hi Bob,

Thank you that works great, i apologise for my ignorance but am a newbie
to this game, but getting there slowly with all of your help.

Thanks again to you all

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Extract Key word 1
Use part of string 5
Personal.xls 8
Set Column width 2
Select current region and print 2
Check on the input in an inputbox 5
Protect file name 2
Insert the value from an input box 2

Top