Hi Guys,
I'm a total newb at VBA so please excuse any possible nonsense.
I've searched the web and this site for possible solutions to no vail.
I have a data extract in excel that changes is size everyday
today the data range is A1:R5232 with a header. It's always saved to a new workbook "GRID.xls" on a single sheet "sheet1".
I'm trying to write code in a different workbook "Summary.xls" because the data is obtain separately by various users on different computers.
I managed to open the workbook on any machine so far (assuming it's save to the desktop) using code I found online:
Sub Openworkbook()
Dim objWSHShell As Object
Dim strSpecialFolderPath As String
Dim completename As String
'On Error GoTo ErrorHandler
' Create a shell object
Set objWSHShell = CreateObject("WScript.Shell")
' Find out the path to the passed special folder,
SpecialFolderPath = objWSHShell.SpecialFolders("Desktop")
completename = SpecialFolderPath & "\DGGRID.xls"
Workbooks.Open filename:=completename
' Clean up
Set objWSHShell = Nothing
ErrorHandler:
MsgBox "Error finding " & strSpecialFolder, vbCritical + vbOKOnly, "Error"
End Sub
my remaining goals:
1. check the the size of the data range in "sheet1"
2. Sort it by the values in column "R"
3. count the number of rows whose value is in colunm "R" is NOT "CMP"
4. create an array of the proper size using the count of rows meeting the critia above.
5. copy all rows that met the criteria of column "R" to the new array.
thank you for any help you may be able to provide,
Holl
I'm a total newb at VBA so please excuse any possible nonsense.
I've searched the web and this site for possible solutions to no vail.
I have a data extract in excel that changes is size everyday
today the data range is A1:R5232 with a header. It's always saved to a new workbook "GRID.xls" on a single sheet "sheet1".
I'm trying to write code in a different workbook "Summary.xls" because the data is obtain separately by various users on different computers.
I managed to open the workbook on any machine so far (assuming it's save to the desktop) using code I found online:
Sub Openworkbook()
Dim objWSHShell As Object
Dim strSpecialFolderPath As String
Dim completename As String
'On Error GoTo ErrorHandler
' Create a shell object
Set objWSHShell = CreateObject("WScript.Shell")
' Find out the path to the passed special folder,
SpecialFolderPath = objWSHShell.SpecialFolders("Desktop")
completename = SpecialFolderPath & "\DGGRID.xls"
Workbooks.Open filename:=completename
' Clean up
Set objWSHShell = Nothing
ErrorHandler:
MsgBox "Error finding " & strSpecialFolder, vbCritical + vbOKOnly, "Error"
End Sub
my remaining goals:
1. check the the size of the data range in "sheet1"
2. Sort it by the values in column "R"
3. count the number of rows whose value is in colunm "R" is NOT "CMP"
4. create an array of the proper size using the count of rows meeting the critia above.
5. copy all rows that met the criteria of column "R" to the new array.
thank you for any help you may be able to provide,
Holl
Last edited: