View Single Post
Old 04-12-2011, 09:38 AM
cg1980 cg1980 is offline Windows XP Office 2003
Join Date: Apr 2011
Posts: 1
cg1980 is on a distinguished road
Default Macro date and match valor

I want to do a VBA code for the following situation :

(For instance let s do with the ISINcode Sheet2 « AT0000386198 »)

Si colAI(Feuil2) >colF(feuil1) (we need to compare the valor for the same Identifier
And if colAI(Feuil2)>colAZ(Feuil2) (pas grave si AY vide)

Sub Cedola()
Dim cel As Range 'déclare la variable cel (CELlule)
Dim pl As Range 'déclare la variable pl (PLage)
Dim r As Range 'déclare la variable r (Recherche)
Dim ca As Double 'déclare la variable ca (CAlcul)

Set pl = Sheets("Fontedati1").Range("A3:A" & Sheets("Fontedati1").Range("A65236").End(xlUp).Row ) 'définit la plage pl
For Each cel In pl 'boucle sur toutes les cellules cel de la plage pl
'déinit la recherche
Set r = Sheets("FonteMovimentazione1").Columns(1).Find(cel .Value, , xlValues, xlWhole) 'recherche dans la colonne A de l'onglet "Feuil1" la valeur de la cellule cel
If Not r Is Nothing Then 'condition 1 : si il existe au moins une occurrence
'condition 2 : si la colonne AI de cel est supérieure à la colonne F de r et si la colonne AI de cel est supérieure à la colonne AY de cel
If cel.Offset(0, 34).Value > r.Offset(0, 5).Value And cel.Offset(0, 34).Value > cel.Offset(0, 50) Then
This part above is ok

What i want to do:

Take the date in AI sheet2 as reference (15.07.10) which correpons to the col AI for the code AT0000386198

Go on sheet 3 in CW corresponding to 15.07.10(col CS) and do a copy paste « valor » of all the series in CW (from CW (15.07.10) up to CW117(fix))

3.CV47=CV47(CW (15.07.10)-1)

4.Copy AI(Sheet2) in AZ (Sheet2) Still for the AT0000386198

And we do this in a loop scanning all the ISIN code in sheet2
Thank you very much for help
Attached Files
File Type: xls Macro date.xls (31.5 KB, 1 views)
Reply With Quote