Home |
Search |
Today's Posts |
#15
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Garry,
Am Tue, 30 Jun 2015 02:40:22 -0400 schrieb GS: Sub Run37Hours() Dim n&, sRefs$, vRefs sRefs = "AG19, AG21:AG27, AG29:AG35, AG39:AG44, AG47, AG49," sRefs = sRefs & "AG52, AG55:AG60, AG63:AG66, AG69, AG73:AG78" vRefs = Split(sRefs, ",") With Sheets("Sheet2") .Unprotect 'feed in the values For n = LBound(vRefs) To UBound(vRefs) With Range(vRefs(n)) .Formula = Range("AG5").Formula: .value = .value End With Next 'n .Protect End With End Sub into the area you now have the correct values. But the values of the area is repeated in the other areas. Regards Claus B. Well.., they all use the same formula. Perhaps the formula should be loaded into a var... Sub Run37Hours() Dim n&, sFormula$, sRefs$, vRefs sFormula = Range("AG5").Formula sRefs = "AG19, AG21:AG27, AG29:AG35, AG39:AG44, AG47, AG49," sRefs = sRefs & "AG52, AG55:AG60, AG63:AG66, AG69, AG73:AG78" vRefs = Split(sRefs, ",") With Sheets("Sheet2") .Unprotect 'feed in the values For n = LBound(vRefs) To UBound(vRefs) With Range(vRefs(n)) .Formula = sFormula: .value = .value End With Next 'n .Protect End With End Sub -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to have a macro simply issue the "find" command or "control f: | Excel Programming | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
Revisiting "New issue with "With" statment" post from 6/7/07 | Excel Programming | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |