Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"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. -----Original Message----- Thank you in advance for any assistance! I truly value any advice 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 the lifetime of the contract in relation to the current date. Column 3 is blank. Would it be possible to loop through a selected range in column 2 and if the word "Flow" appears, then take the contract ID in column 1 and transfer it to column 3 -- one after the other so that the blanks in 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 manner from here. Sorry. Thanks again for any assistance! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Pete,
I have not had the time to apply the code, but I am grateful for you time -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selcting data from table without repeating plus calc's | Excel Worksheet Functions | |||
data validation list: how do i 'force' a user to enter data from the list? | Excel Discussion (Misc queries) | |||
data validation list: how do i 'force' a user to enter data from the list? | Excel Discussion (Misc queries) | |||
How to view a list of data based on another list of data | Excel Discussion (Misc queries) | |||
converting vertical data list to horizontal data list | Excel Worksheet Functions |