Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default cell.value comply with cell.value before and cell.value after

On 24 feb, 16:55, Paul Robinson wrote:
Hi
Try this. It's a bit rough & the first if line is one long line.
Select the single column of info you want to parse & run the sub. Sub
assumes there are at least 3 rows in the column.
Sub tester()
Dim rng As Range
Dim i As Long
Set rng = Selection
With rng
For i = 2 To .Count - 1
* * If Trim(.Cells(i, 1).Value) < Trim(.Cells(i - 1, 1).Value) And
Trim(.Cells(i, 1).Value) < Trim(.Cells(i + 1, 1).Value) Then
* * * * If Trim(.Cells(i - 1, 1).Value) = Trim(.Cells(i + 1, 1)..Value)
Then
* * * * .Cells(i, 1).Value = Trim(.Cells(i - 1, 1).Value)
* * * * End If
* * End If
Next i
End With
Set rng = Nothing
End Sub

regards
Paul

On Feb 24, wrote:



Hi Expert,


In column C which is sorted based on column D, *groups of words
emerge. Occasionally a
deviant word occurs within such a group of uniform words, eg.:


row column C
1 * * Word
2 * * Word
3 * * Word
4 * * ord
5 * * Word
6 * * Word
7 * * From
8 * * From
etc. etc.


Is there some way I can make 'ord' like 'Word' and loop through the
whole of Column C to fix similar situations.
The condition is that ord lies between two similar words, 'Word'. When
row 7 starts with a new group of Words, eg From, this From word will
be left untouched.


Would be happy if you could share some knowledge
ppeer- Tekst uit oorspronkelijk bericht niet weergeven -


- Tekst uit oorspronkelijk bericht weergeven -


Works 100% and speed is fast!

best regards
Peter
Reply
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
cell.value comply with cell.value before and cell.value after Paul Robinson Excel Programming 0 February 24th 10 03:55 PM
cell.value comply with cell.value before and cell.value after ppeer Excel Programming 0 February 24th 10 02:04 PM
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Excel Discussion (Misc queries) 0 June 29th 09 11:20 AM
NEED VBA TO SELECT A CELL; NOTE THE CELL VALUE;COPYADJ CELL;FIND CELL VALUE IN A RANGE AND SO ON CAPTGNVR Excel Programming 2 July 8th 07 04:18 PM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM


All times are GMT +1. The time now is 10:00 PM.

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

About Us

"It's about Microsoft Excel"