View Single Post
 
Old 07-16-2014, 04:44 AM
BobBridges's Avatar
BobBridges BobBridges is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

I'm not sure from what you wrote whether you know this already, but the most obvious way to save a value and use it later is to set a variable of your own, perhaps like this:
Code:
For jr = 2 To rz
  Select Case ows.Cells(jr, 7).Value
    Case "Phase"
    Case "Sub-Phase"
      col4 = ows.Cells(jr, 4).Value
    Case Else
      ows.Cells(jr, 3).Value = col4
    End Select
  Next jr
The name of the variable is pretty much up to you; there are certain values VBA won't let you use (you can look them up if you want) but mostly you can pick any name that makes sense to you.

"Group!" (he says thoughtfully); I didn't think of applying that here. (Pause to think about it a while.) But no, the problem with grouping is that what you really want is to copy the Sub-Phase value in D to the lower level in a new column; grouping won't help you with that. Interesting thought, though; I'll have to keep it in mind for other tasks where it might not ordinarily have occurred to me.
Reply With Quote