hatemhatem
New Member
- Joined
- Mar 1, 2010
- Messages
- 21
hi, i have a problem in using vba and each time I run my project I get
Runtime error "9" Subscript out of range :'(
and the line of code in question is:
pr_pri.Worksheets("wspr_pri").Cells(13, 4).Activate
here's the entire code for the macro:
plz help
Runtime error "9" Subscript out of range :'(
and the line of code in question is:
pr_pri.Worksheets("wspr_pri").Cells(13, 4).Activate
here's the entire code for the macro:
Code:
Sub prpri()
Dim i%, j%, k%
Dim iLRA As String, iLRN As String
Dim Y As Boolean, Ys As Boolean
Dim TabloA(), TabloN()
Dim pr As Workbook, pri As Workbook, pr_pri As Workbook
Dim wspr As Worksheet, wspri As Worksheet, wspr_pri As Worksheet
'Détermination du nombre de ligne de Classeur "pr" et "pri" et "pr_pri"
Set pr = Workbooks("PR_DETAIL(GD330_ANLDSV).xls")
Set pri = Workbooks("GD330AT-00-V10o-204-XX-JAN-12-2010+0_PRI.xls")
Set pr_pri = Workbooks("PR-PRI Check 2.2 GD330AT-00-V10o-204-XX-JAN-12-2010+0_PRI.xls")
Set wspr = pr.Worksheets("PR_DETAIL(GD330_ANLDSV)")
Set wspri = pri.Worksheets("PRI DATA")
Set wspr_pri = pr_pri.Worksheets("Feuil1")
Workbooks("PR_DETAIL(GD330_ANLDSV).xls").Activate
Workbooks("GD330AT-00-V10o-204-XX-JAN-12-2010+0_PRI.xls").Activate
Workbooks("PR-PRI Check 2.2 GD330AT-00-V10o-204-XX-JAN-12-2010+0_PRI.xls").Activate
pr_pri.Worksheets("wspr_pri").Cells(13, 4).Activate
pr.Worksheets("wspr").Range("D5").Activate
pri.Worksheets("wspri").Range("F9").Activate
iLRA = Worksheets("wspr").Range("D5").Value
Worksheets("wspr_pri").Range("D13").Value = iLRA
iLRN = Worksheets("wspri").Range("F9").Value
Worksheets("wspr_pri").Range("E13").Value = iLRN
If iLRA <> iLRN Then
Worksheets("wspr_pri").Range("H13").Value = "NG"
Else: Worksheets("wspr_pri").Range("H13").Value = "OK"
End If
End Sub
plz help
Last edited by a moderator: