Selcting data from a list

  • Thread starter Thread starter oakman
  • Start date Start date
O

oakman

Thank you in advance for any assistance! I truly value any advic
given!
I have 3 columns. Column 1 displays contrac ID for about 10 contracts
Column 2 is either blank or has the word "Flow" depending on th
lifetime of the contract in relation to the current date. Column 3 i
blank.
Would it be possible to loop through a selected range in column 2 an
if the word "Flow" appears, then take the contract ID in column 1 an
transfer it to column 3 -- one after the other so that the blanks i
column 2 are eliminated?
So far, I have only been able to come up with this code:
Sub CURRENT_CONTRACT()
Set rng = Range("G4:G13")
Sheets("CONTRACTS").Select

For Each Cell In rng
If Cell.Value = "Flow" Then

Unfortunately, I don't have the knowledge to advance in a clear manne
from here. Sorry. Thanks again for any assistance
 
"Oakman",

I've made some assupmtions based on the ranges you used
and I just made this code up rather than actually test it,
but it should work:

Sub FindFlow()

option compare text

Dim rng as Range
Dim cl as Range

Sheets("Contracts").select

Set rng = Range("G4:G13")

For each cl in rng.cells
If cl.value = "Flow" Then
cl.Offset(1,0).value = cl.offset(-1,0).value
End If
Next cl

Set rng = nothing

End Sub

'Cheers, Pete.
 
Thank you Pete,

I have not had the time to apply the code, but I am grateful for you
time
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top