![]() |
|
#1
|
||||
|
||||
![]()
Hi S7y,
Thanks for the explanation, but it's not really what I need. I need a workbook that is truly representative. It doesn't matter whether the data are real or fake - so long as they depict the structure of the real workbook and the kind of data it contains. If I understand your latest post correctly, the workbook structure does represent the real one's layout, just not the kind of data or the shading. In that case, try: Code:
Sub GetColRef() Application.ScreenUpdating = False Dim i As Long, j As Long, Rng As Range With ThisWorkbook.Worksheets("Data") j = .Range("A" & .Rows.Count).End(xlUp).Row For i = 2 To j .Cells(i, 5).Value = "" Set Rng = ThisWorkbook.Worksheets("Report").Cells.Find(what:=Right(.Cells(i, 2).Value, 8), LookIn:=xlValues, _ LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=True) If IsNumeric(Rng.Offset(-1, 0).Value) Then If Rng.Offset(-1, 0).Value > 0 And Rng.Offset(-1, 0).Value < 100 Then .Cells(i, 5).Value = Rng.Offset(-1, 0).Value End If End If If IsNumeric(Rng.Offset(4, 0).Value) Then If Rng.Offset(4, 0).Value > 0 And Rng.Offset(4, 0).Value < 100 Then .Cells(i, 5).Value = Rng.Offset(4, 0).Value End If End If Next End With Set Rng = Nothing Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can I create a formula that will show result in the same cell and let me copy it down | CranstC | Excel | 1 | 02-11-2012 01:29 AM |
How can I delete the content of a cell in column if the cell value is more than 1000? | Learner7 | Excel | 2 | 06-27-2011 05:44 AM |
Question: Hyperlink to other show, but close the current show | habibfikri | PowerPoint | 0 | 12-26-2010 02:37 AM |
How can I fill cell color starting from Cell D5 using Conditional formatting instead | Learner7 | Excel | 0 | 07-08-2010 05:50 AM |
Auto-populate an MS Word table cell with text from a diff cell? | dreamrthts | Word Tables | 0 | 03-20-2009 01:49 PM |