View Full Version : display records by office

04-28-2010, 09:44 AM
I am a newbie in Excel/VBA.
would you please help me to figure out this project.
First, get the data from source.
Second, Display the data based on office in the certain office place in Result sheet.
see attached excel file. would you help me
the following is so far what I done;

Sub ExtractDept()
Dim i As Integer
Dim intCount As Integer
Dim strDept As String
Dim startpoint As String
Dim Msg As String
Dim rngCell As Range
Dim strYesNo As String
Application.DisplayAlerts = False
'reference the range;NQ,SR,GP,WR,CC,DC
strDept = Range(OFFICE)
startpoint = Range(startarea)
'In a certain office area, paste records according to Office In Result sheet

Sheets(strDept & "Sheet").Range("a1").Select

Do While Range("start").Offset(i, 1) <> ""
If Range("start").Offset(i, 1) = strDept Then
' go to startpoint place ; startarea=strDept
Range(Range("start").Offset(i, 0), Range("start").Offset(i, 4)).Copy
intCount = intCount + 1
sht.Range("a1").Offset(intCount, 0).Select
End If
i = i + 1

ActiveWindow.DisplayGridlines = False

End Sub

04-28-2010, 12:53 PM
Thread moved to Excel Help forum