Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel
|
|||
|
|||
![]()
Thanks. I will try.
"Dave Peterson" ???????/???????? ? ???????? ?????????: ... 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 |
#6
![]()
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Dmitry,
Try something like: '============= Public Sub Tester() Dim SH As Worksheet For Each SH In ActiveWindow.SelectedSheets With SH Application.Goto .Range("J16") 'Your Solver code End With Next SH End Sub '<<============= --- Regards, Norman "Dmitry" wrote in message ... 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 |
#7
![]()
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks. I will try.
"Norman Jones" сообщил/сообщила в новостях следующее: ... Hi Dmitry, Try something like: '============= Public Sub Tester() Dim SH As Worksheet For Each SH In ActiveWindow.SelectedSheets With SH Application.Goto .Range("J16") 'Your Solver code End With Next SH End Sub '<<============= --- Regards, Norman "Dmitry" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Common range name for 2 sheets | Excel Discussion (Misc queries) | |||
Macros for Protect/Unprotect all sheets in a workbook | Excel Discussion (Misc queries) | |||
Dynamic named range across multiple sheets | Excel Discussion (Misc queries) | |||
Copying multiple sheets from one book 2 another and undertake spec | Excel Discussion (Misc queries) | |||
Stubborn toolbars in Excel | Excel Discussion (Misc queries) |