LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default mixing absolute and relative references


Hi everyone.

This is code by JE McGimpsey, modified slightly by me:


Code
-------------------
Sub Find_and_Mark()

Dim c As Range
Dim firstAddress As String

Sheets("Sheet1").Select
With Columns("C:D")
Set c = .Find( _
What:="your_text_string_here", _
LookIn:=xlValues, _
LookAt:=xlPart, _
MatchCase:=False)

If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Offset(0, 20) = "Yes"
Set c = .FindNext(c)
Loop While c.Address < firstAddress
End If

End With
End Su
-------------------


Basically, it searches for a string, and each time it finds anothe
instance of the string, it marks "Yes" 20 columns over. However, I'
doing a search in both column C and in column D, so 20 columns ove
means either column W or column X respectively.

How do I mix relative and absolute references in this case? Fo
example, how would I modify this if I need the row reference to b
relative, but I always want the column to be column X

--
shellshoc
-----------------------------------------------------------------------
shellshock's Profile: http://www.excelforum.com/member.php...fo&userid=2493
View this thread: http://www.excelforum.com/showthread.php?threadid=46760

 
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
absolute & relative references zzulu4 Excel Discussion (Misc queries) 2 April 1st 09 05:54 PM
Absolute and Relative Cell References Karen Excel Discussion (Misc queries) 1 April 1st 09 09:41 AM
Mixing absolute & relative reference Gilbert DE CEULAER Excel Worksheet Functions 3 December 23rd 08 11:54 AM
Help with converting a block of cells with Absolute and mixed references to relative references Vulcan Excel Worksheet Functions 3 December 13th 07 11:43 PM
Absolute / Relative References Tim Mills Excel Programming 2 July 25th 05 12:32 PM


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

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

About Us

"It's about Microsoft Excel"