LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default .Value "issue"

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to have a macro simply issue the "find" command or "control f: Charles Adams Excel Programming 3 February 6th 09 06:34 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Revisiting "New issue with "With" statment" post from 6/7/07 robs3131 Excel Programming 2 June 12th 07 04:27 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 07:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"