finding a cell

R

rbekka33

I have a range of cells (codes) in column h which is dynamic.

I need to cycle through these cells and for each of them find
corresponding cell (or code) in a different workbook.

I then need to copy the row based on that cell (code) from tha
workbook back to another sheet in the first and paste it right at th
bottom.

I think I probably need a With every statement or a loop - but I am no
sure how to start.

Sub FindCode()


FName = ActiveWorkbook.Name 'Save active workbook file name t
variable FName
FPath = ActiveWorkbook.Path 'Save active workbook path t
variable FPath


' With Worksheets(1).Range("NoBlanksRange")
' Set c = .Find(2, LookIn:=xlValues)
' ActiveCell.Select
' Application.CutCopyMode = False
CC = ActiveCell.Copy
Windows("Source.xls").Activate
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.Find(What:="CC", After:=ActiveCell, LookIn:=xlFormulas
_
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext
_
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
'Application.CutCopyMode = False
Selection.Copy
Windows(FName).Activate
Sheets("Data").Select
Range("a2").Select
Range(Selection, Selection.End(xlDown)).Select

ActiveCell.Offset(-1, 0).Range("A1").Activate
'ActiveSheet.Paste
End Su
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top