سلام اقای اسماعیلی میشه در مورد کد توضیح بدید:
کد PHP:
Private Sub CommandButton1_Click()
Dim LastRow As Long
With Sheet1
LastRow = .Cells(.Rows.Count, "D").End(xlUp).Row
End With
With Sheet1.Range("D6:D" & LastRow) ' you can change this to any range
thingToLookFor = InputBox("Please Enter starting point")
Set FoundIt = .Find(thingToLookFor, LookIn:=xlValues, LookAt:=xlWhole)
If Not FoundIt Is Nothing Then FirstAddress = FoundIt.Row
thingToLookFor2 = InputBox("Please Enter distination point")
Set FoundIt2 = .Find(thingToLookFor2, LookIn:=xlValues, LookAt:=xlWhole)
If Not FoundIt2 Is Nothing Then FirstAddress2 = FoundIt2.Row
Sheet1.Range("i10").Value = thingToLookFor
Sheet1.Range("h10").Value = thingToLookFor2
Sheet1.Range("J10").Value = FirstAddress2 - FirstAddress + 1
End With
End Sub
علاقه مندی ها (Bookmarks)