Cell reference

Last Edited By Krjb Donovan
Last Updated: Mar 05, 2014 09:17 PM GMT

Question

hi i try to find a cell reference by recording a macro i get this code:

Range("A1").Select

   Selection.Copy
   Cells.Find(What:="1370", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
       xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
       , SearchFormat:=False).Activate

End Sub

mi problem is that im not always looking for 1370 value, since A1 is always changing its value. i apreciate if u can help me

Answer

you macro seems to just be a find macro, which I'm not sure is what you want - if it is, I'd just press Ctrl F and type in the value I wanted - quicker than running a macro. Knowing the rest of the process would help as I could suggest a method of doing what you actually need to do. this macro also copies a value and then ignores it - so maybe

Cells.Find(What:=range("a1").value, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
      xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
      , SearchFormat:=False).Activate


would help - however, I'm sure the underlying macro needs to do more!

Advertisement

©2017 eLuminary LLC. All rights reserved.