To adapt this macro for relative lines

hoareau

Board Regular
Joined
Apr 11, 2007
Messages
51
To adapt this part of macro below for relative lines


Code:
For J = 1 To 8

vN(J) = Sheets("feuil3").Cells(J).Value 'J 

Next



Sub Combin_6N()
Dim A As Integer, B As Integer, C As Integer
Dim D As Integer, E As Integer, F As Integer
Dim I As Long, J As Integer, vN(10) As Integer
Application.ScreenUpdating = False


For J = 1 To 8

vN(J) = Sheets("feuil3").Cells(J).Value 'J 

Next




J = J - 1

ActiveCell.Offset(0, 17).Select
'Range("a32").Select ' Pour deplacer les combinaisons à l'endroit souhaité
I = 1
For A = 1 To J - 5
For B = A + 1 To J - 4
For C = B + 1 To J - 3
For D = C + 1 To J - 2
For E = D + 1 To J - 1
For F = E + 1 To J
ActiveCell.Offset(0, 0).Value = I
ActiveCell.Offset(0, 1).Value = vN(A)
ActiveCell.Offset(0, 2).Value = vN(B)
ActiveCell.Offset(0, 3).Value = vN(C)
ActiveCell.Offset(0, 4).Value = vN(D)
ActiveCell.Offset(0, 5).Value = vN(E)
ActiveCell.Offset(0, 6).Value = vN(F)
I = I + 1
ActiveCell.Offset(1, 0).Select
Select Case I
Case 60001, 120001, 180001, 240001, 300001, 360001, 420001, 480001, 540001
ActiveCell.Offset(-60000, 8).Select
End Select


Next F
Next E
Next D
Next C
Next B
Next A
Range("A1").Select


End Sub

[Added code tags~VP]
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Bonjour,

Il semblerait que ton post ne soit pas assez clair pour comprendre ce que tu essaie de faire. C'est sans doute pour ca que tu n'as pas eu de reponse.

To adapt this part of macro below for relative lines

Essai d'etre plus explicite ou poste clairement en francais et je te ferai une traduction anglaise si necessaire.

=============================

Hello,

It seems that your post is not clear enough to understand what you are trying to do. This is probably why you didn't get an answer.

To adapt this part of macro below for relative lines

Try to be more explicit or post it clearly in French and I will translate in English if necessary.
 
Upvote 0
Bonjour

Merci pour la proposition,mais j'ai fini par trouver.

Tout ce que je voulais c'est que la macro au lieu de tenir compte des chiffres de la colonne vers le bas

ex:

A1:A10

tienne compte des chiffres de la ligne

Ex ABCDEFGh


Comme j'ai une centaine de lignes avec des chiffres diiférents,elle devait s'adapter à chaque ligne.

Maintenant je suis un autre problème, pour moi en tous cas.

Merci encore de la proposition
 
Upvote 0

Forum statistics

Threads
1,223,970
Messages
6,175,699
Members
452,667
Latest member
vanessavalentino83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top