Macrodroid
New Member
- Joined
- Nov 10, 2011
- Messages
- 5
Hello everyone, I’m new to excel forums so bear with me on this one.
I’ve tried a bit of everything, but my programing skills with excel are limited.
The idea i have is the next:
Got 2 files:
1º - Where all the details are found and from where it will be extracted.
2º - Where the data will be copied to. The cell that was searched for, will be searched in this file too to paste
in other words, I need to be able to extract and make a loop search of all that is in Range(AH13:AH67) and for each that is found, run the code that comes after(or something similar)
Or that list or the list that’s in the file 1 in column AB to make the search faster.
(This last list has never the same amount of weeks and cells occupied. Only the ones illustrated in the document.)
Ill paste the code of what i intend to do
Hopfully ill just need to put some if's and then's around.
Ill appreciate all the help given
PD: sorry if ive spelled something wrong
I’ve tried a bit of everything, but my programing skills with excel are limited.
The idea i have is the next:
Got 2 files:
1º - Where all the details are found and from where it will be extracted.
2º - Where the data will be copied to. The cell that was searched for, will be searched in this file too to paste
in other words, I need to be able to extract and make a loop search of all that is in Range(AH13:AH67) and for each that is found, run the code that comes after(or something similar)
Or that list or the list that’s in the file 1 in column AB to make the search faster.
(This last list has never the same amount of weeks and cells occupied. Only the ones illustrated in the document.)
Ill paste the code of what i intend to do
Hopfully ill just need to put some if's and then's around.
Code:
[B][FONT=Arial][SIZE=2][COLOR=#000000]
Sub Copy1()
'
' Copy1 Macro
' Copy of planning
'
''''''
strName = Range("I3") 'Name of the user
StrFilePlan = Range("I5") 'Company time table
StrHojaPlan = Range("I6") 'Company time table page
strFileMio = Range("I4") 'Actual file name
strFileDIR = Range("I7") 'DIR Planning file
''''''''''''''''''''''''''''''''''''''''''''''''
'Search for week || copy and paste
''''''''''''''''''''''''''''''''''''''''''''''''
Workbooks(StrFilePlan).Activate
[A:Z].Find(What:="semaine 46", After:=ActiveCell, LookIn:=xlFormulas _
, lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select
Selection.Resize(Selection.Rows.Count + 1, _
Selection.Columns.Count).Copy
''''''
'Paste
''''''
Windows(strFileMio).Activate
[A:Z].Find(What:="semaine 46", After:=ActiveCell, LookIn:=xlFormulas _
, lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select
ActiveSheet.Paste
''''''Search for user | Copy and Paste''''''
Workbooks(StrFilePlan).Activate
'''Search for week entry
[A:Z].Find(What:="semaine 46", After:=ActiveCell, LookIn:=xlFormulas _
, lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select
Selection.Resize(Selection.Rows.Count + 55, _
Selection.Columns.Count).Select
'''Search for name entry
Selection.Find(What:=strName, After:=ActiveCell, LookIn:=xlFormulas _
, lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select
Selection.Resize(Selection.Rows.Count, _
Selection.Columns.Count + 24).Copy
Windows(strFileMio).Activate
[A:Z].Find(What:="semaine 46", After:=ActiveCell, LookIn:=xlFormulas _
, lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select
ActiveCell.Offset(2, -1).Select
ActiveSheet.Paste
End Sub
[/COLOR][/SIZE][/FONT][/B]

PD: sorry if ive spelled something wrong
Last edited: