Declare Function GetComputerName& Lib "Kernel32" Alias "GetComputerNameA" (ByVal lbbuffer As String, nSize As Long)
Sub AfficherNomPC()
Dim Info As String * 64
GetComputerName Info, 64
MsgBox Info
End Sub
Sub trouvCell()
Dim x As Range, s As String
s = "adresse4"
With ActiveSheet.Range("B1:B" & Range("B65536").End(xlUp).Row) 'prend en compte les cellules éditée de la colonne B
Set x = .Find(s, , xlValues, xlWhole)
If Not x Is Nothing Then MsgBox s & " trouvé sur la ligne : " & x.Row
End With 'fin de la prise en compte des cellules éditées de la colonne B
End Sub
Sub TrouvCell()
Dim x As Range, s As String, ligadr4(1000)
s = "adresse4"
'With ActiveSheet.Range("B1:B" & Range("B65536").End(xlUp).Row) 'prend en compte les cellules éditée de la colonne B
n = 1
For Each cell In Range("B1:B1000")
Set x = cell.Find(s, , xlValues, xlWhole)
'If Not x Is Nothing Then MsgBox s & " trouvé sur la ligne : " & x.Row: ligadr4(n) = x.Row: n = n + 1
If Not x Is Nothing Then ligadr4(n) = x.Row: n = n + 1
Next
'End With 'fin de la prise en compte des cellules éditées de la colonne B
'Stop
For i = 1 To n - 1
MsgBox ligadr4(i)
Next
End Sub
Declare Function GetComputerName& Lib "Kernel32" Alias "GetComputerNameA" (ByVal lbbuffer As String, nSize As Long)
Sub AfficherNomPC()
Dim Info As String * 64
GetComputerName Info, 64
If Info = "LENOVO-B4562" Then MsgBox Info
End Sub