Good afternoon, all!
I have been searching for a way (or even a hint of) a way to do the following in a workbook I open with a GetOpenFilename macro:
1) Search for a certain string (ie. "Date of Birth")
2) Copy the values from the "Date of Birth" column into my original workbook (the one that contains the GetOpenFilename coding).
Just to complicate matters there have been several iterations of the workbooks I need to open. Added to that is the fact that the "Date of Birth" column will not always be in the same spot on every workbook. It may start in [C4] in one workbook and start on [F9] in another. Their lengths will also be different.
Trying the macro recorder gives me an idea of what i am trying to accomplish, but I am having a hard time figuring out how to have the code move to the cell directly below the cell that contains "Date of Birth". The code simply selects a specific cell in the macro recorder.
Any hints or tips will be appreciated.
Here's the code thus far:
[CODE
Sub TryThis2()
Cells.Find(What:="Birth", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
Range("E14").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
ActiveWindow.ActivateNext
Range("C5").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "mm/dd/yy"
Range("C4").Select
End Sub
CODE]
Thanks
In the immortal words of Socrates, who said:
"I drank what?
I have been searching for a way (or even a hint of) a way to do the following in a workbook I open with a GetOpenFilename macro:
1) Search for a certain string (ie. "Date of Birth")
2) Copy the values from the "Date of Birth" column into my original workbook (the one that contains the GetOpenFilename coding).
Just to complicate matters there have been several iterations of the workbooks I need to open. Added to that is the fact that the "Date of Birth" column will not always be in the same spot on every workbook. It may start in [C4] in one workbook and start on [F9] in another. Their lengths will also be different.
Trying the macro recorder gives me an idea of what i am trying to accomplish, but I am having a hard time figuring out how to have the code move to the cell directly below the cell that contains "Date of Birth". The code simply selects a specific cell in the macro recorder.
Any hints or tips will be appreciated.
Here's the code thus far:
[CODE
Sub TryThis2()
Cells.Find(What:="Birth", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
Range("E14").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
ActiveWindow.ActivateNext
Range("C5").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "mm/dd/yy"
Range("C4").Select
End Sub
CODE]
Thanks
In the immortal words of Socrates, who said:
"I drank what?