Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
finding a cell
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 -- rbekka3 ----------------------------------------------------------------------- rbekka33's Profile: http://www.excelforum.com/member.php...fo&userid=1403 View this thread: http://www.excelforum.com/showthread.php?threadid=26271 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
finding a cell
Hi
see: http://www.rondebruin.nl/copy5.htm -----Original Message----- 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 a corresponding cell (or code) in a different workbook. I then need to copy the row based on that cell (code) from that workbook back to another sheet in the first and paste it right at the bottom. I think I probably need a With every statement or a loop - but I am not sure how to start. Sub FindCode() FName = ActiveWorkbook.Name 'Save active workbook file name to variable FName FPath = ActiveWorkbook.Path 'Save active workbook path to 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 Sub -- rbekka33 ---------------------------------------------------------- -------------- rbekka33's Profile: http://www.excelforum.com/member.php? action=getinfo&userid=14033 View this thread: http://www.excelforum.com/showthread...hreadid=262713 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Finding a cell location | New Users to Excel | |||
finding last non-blank cell and then copying it to the next cell | Excel Discussion (Misc queries) | |||
Finding Corresponding Cell Value | Excel Discussion (Misc queries) | |||
Finding last cell | Excel Worksheet Functions | |||
Finding a cell | Excel Programming |