View Single Post
  #5   Report Post  
Don Guillett
 
Posts: n/a
Default

try this idea. modify to suit your needs to exclude certain ws. What do you
want to do with the blank cells?

for each ws in worksheets
if ws.name < "ws14" then
ws.SpecialCells(xlCellTypeBlanks).do something withOUT selecting
end if
next ws
========
Here's another idea
Dim MySh(1 To 10)
For i = 1 To 10
MySh(i) = "Sheet" & i
Next i
Sheets(MySh).dosomething
===========
repeat for 13 to 15, etc

--
Don Guillett
SalesAid Software

"Hidaya" wrote in message
...
Hi Don ,
When I use for... each ws in worksheet, there is an error "Run time error
1004.No cells were found." at this code.

Selection.SpecialCells(xlCellTypeBlanks).Select

And it doesn't move to the next worksheet. Is there a way to make the

macro
run only on selected worksheets only (e.g WS1 to WS10, WS13 to WS 15 etc
...)?. Thank you.



"Don Guillett" wrote:

for each ws in worksheets
your code
next ws

BTW. Your code could be more efficient by getting rid of selections.

Example
========
Columns("s").Value = Columns("s").Value

Columns("S:S").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,

SkipBlanks:=
_
False, Transpose:=False
Application.CutCopyMode = False
==================