View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default How to repeat a code for selected sheets (or a contiguous range of

Maybe...

For each ws in ActiveWindow.selectedSheets

Dmitry wrote:

Thanks Viquar for replying.
Does "For each ws in ActiveWorkbook.Sheets" repeats for all worksheets? I
wrote "How to repeat a code for selected sheets (or a contiguous range of
sheets) in a Workbook?", not all worksheets.
"Viquar" сообщил/сообщила в новостях
следующее: ...
For each ws in ActiveWorkbook.Sheets
ws.Range("J16").Select
SolverOk SetCell:="$J$16", MaxMinVal:=1, ValueOf:="0",
ByChange:="$F$4:$I$12"
SolverSolve UserFinish:=True

Next

"Dmitry" wrote:

Hello
How to repeat a code for selected sheets (or a contiguous range of

sheets)
in a Workbook?
The code is:
Range("J16").Select
SolverOk SetCell:="$J$16", MaxMinVal:=1, ValueOf:="0",
ByChange:="$F$4:$I$12"
SolverSolve UserFinish:=True




--

Dave Peterson