Hai,
i have code to collect data from one area to another area. it contains huge data and by the below code it sorted to display in new area
based on date and number value.
it copies all data and fill in one area automatically, however the cursor in excel remains in same place while the data being copied and sorted.
I need cell cursor to move to cell every time, i mean active cell, where the data is pasted.
Please help.
Regards,
ebincharles P
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)
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