Select method or object

  • Thread starter Thread starter kaide, Lai
  • Start date Start date
K

kaide, Lai

What should I write (in VBA) if I wanted my procedure to take reference
from the active cells I have selected;
(& enable them to do something like change to mixed case)

The active cells may be from different cell locations & worksheets which
are not pre-determined.

Thank you.

** Posted via: http://www.ozgrid.com
Excel Templates, Training, Add-ins & Business Software Galore!
Free Excel Forum http://www.ozgrid.com/forum ***
 
Hi
try something like
sub foo()
dim rng as range
dim cell as range

set rng = selection
for each cell in rng
'do some stuff with cell. e.g.
cell.value = UCase(cell.value)
next
end sub
 
Hi

Franks code is likley to be what you need. However, there can only ever
be one active cell and Selection will only include the active sheet.
They can however be non-contiguous

** Posted via: http://www.ozgrid.com
Excel Templates, Training, Add-ins & Business Software Galore!
Free Excel Forum http://www.ozgrid.com/forum ***
 
Back
Top