OVH Cloud OVH Cloud

Partage code

2 réponses
Avatar
John Smith
Salut,
J'ai écris ce code je ne l'ai pas trouvé sur le net alors je le partage avec
vous
C'est une fonction qui existe dans excel
la croix qui copie une cellule vers d'autre

Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As
Single, y As Single)
If Button = 1 And Shift = 1 Then
Set Me.MouseIcon = LoadPicture(App.Path & "\cross.cur")
Me.MousePointer = vbCustom
End If
End Sub

Private Sub MSFlexGrid1_MouseUp(Button As Integer, Shift As Integer, x As
Single, y As Single)
Dim i As Integer
Dim z As Integer
If Button = 1 And Shift = 1 Then
If MSFlexGrid1.Row <> MSFlexGrid1.RowSel Then
For z = MSFlexGrid1.Col To MSFlexGrid1.ColSel
For i = MSFlexGrid1.Row To MSFlexGrid1.RowSel
With MSFlexGrid1
.TextMatrix(i, z) = .TextMatrix(MSFlexGrid1.Row, MSFlexGrid1.Col)
End With
Next i
Next z
End If
End If
Me.MousePointer = vbDefault
End Sub

2 réponses

Avatar
Jean-Marc
"John Smith" a écrit dans le message de
news:_DILf.25546$%
Salut,
J'ai écris ce code je ne l'ai pas trouvé sur le net alors je le


partage avec
vous
C'est une fonction qui existe dans excel
la croix qui copie une cellule vers d'autre

Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer,


x As
Single, y As Single)
If Button = 1 And Shift = 1 Then
Set Me.MouseIcon = LoadPicture(App.Path & "cross.cur")
Me.MousePointer = vbCustom
End If
End Sub

Private Sub MSFlexGrid1_MouseUp(Button As Integer, Shift As Integer, x


As
Single, y As Single)
Dim i As Integer
Dim z As Integer
If Button = 1 And Shift = 1 Then
If MSFlexGrid1.Row <> MSFlexGrid1.RowSel Then
For z = MSFlexGrid1.Col To MSFlexGrid1.ColSel
For i = MSFlexGrid1.Row To MSFlexGrid1.RowSel
With MSFlexGrid1
.TextMatrix(i, z) = .TextMatrix(MSFlexGrid1.Row, MSFlexGrid1.Col)
End With
Next i
Next z
End If
End If
Me.MousePointer = vbDefault
End Sub




Hello,

Pas mal du tout, très pratique!
Merci à toi et bienvenue sur ce groupe :-)

--
Jean-marc
Tester mon serveur (VB6) => http://myjmnhome.dyndns.org
"There are only 10 kind of people
those who understand binary and those who don't."
mailto: remove '_no_spam_' ;
Avatar
Titeuf
Tu pourrais la déposer sur le site vbfrance.com :)

"John Smith" a écrit dans le message de news:
_DILf.25546$%
Salut,
J'ai écris ce code je ne l'ai pas trouvé sur le net alors je le partage
avec vous
C'est une fonction qui existe dans excel
la croix qui copie une cellule vers d'autre

Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x
As Single, y As Single)
If Button = 1 And Shift = 1 Then
Set Me.MouseIcon = LoadPicture(App.Path & "cross.cur")
Me.MousePointer = vbCustom
End If
End Sub

Private Sub MSFlexGrid1_MouseUp(Button As Integer, Shift As Integer, x As
Single, y As Single)
Dim i As Integer
Dim z As Integer
If Button = 1 And Shift = 1 Then
If MSFlexGrid1.Row <> MSFlexGrid1.RowSel Then
For z = MSFlexGrid1.Col To MSFlexGrid1.ColSel
For i = MSFlexGrid1.Row To MSFlexGrid1.RowSel
With MSFlexGrid1
.TextMatrix(i, z) = .TextMatrix(MSFlexGrid1.Row, MSFlexGrid1.Col)
End With
Next i
Next z
End If
End If
Me.MousePointer = vbDefault
End Sub