View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kobayashi[_26_] Kobayashi[_26_] is offline
external usenet poster
 
Posts: 1
Default UsedRange problem

Can the UsedRange method only be used when preceded by 'Activesheet'? I
have a variable for a worksheet which I am trying to use in a 'With'
statement:

With [Variable name]
..UsedRange
and so on.....

but I cannot get this to work unless I replace the place a Select
statement before the 'With' statement and then replace the variable
name with 'Activesheet'?

Now, I am still a relative novice at this Excel VBA stuff but what I
have read in my pursuit of knowledge is that a 'good' programmer will
refrain from using Select/Activate statements in their code wherever
possible? So, I am a both stuck and a little confused???

Therefore, any help in clarifying this would be very much appreciated!

Thanks,

Adrian


---
Message posted from http://www.ExcelForum.com/