Thank you very much Guru Marvin.. I did it.
Copy to clipboard
Option Explicit
Sub OTExtract_Click()
'End Sub
'Sub Extract()
Dim X1 As Integer
Dim X2 As Integer
Dim X3 As Integer
Dim X4 As Integer
Dim na1 As String
Dim na2 As String
Dim date1 As String
Dim date2 As String
Dim thod As String
For X1 = 9 To 100
na2 = Me.Cells(X1, 27)
For X2 = 28 To 36
'row number where all heading lies
date2 = Me.Cells(8, X2)
For X4 = 9 To 8993 '13874
date1 = Me.Cells(X4, 1)
na1 = Me.Cells(X4, 3)
'MsgBox (" -0- " & na1 & " -1- " & na2 & " -2- " & date1 & " -3- " & date2)
If na2 = na1 And date2 = date1 And Me.Cells(X1, X2) = "" Then
Me.Cells(X1, X2) = Me.Cells(X4, 37)
Me.Cells(X1, X2).Select ''Here i placed your code
ElseIf na2 = na1 And date2 = date1 And Me.Cells(X1, X2) <> "" Then
Me.Cells(X1, X2) = Me.Cells(X1, X2) & "/" & Me.Cells(X4, 37)
End If
Next
Next '
Next
End Sub
Bookmarks