Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
Public Sub popicbr(uName As String, uStartDate As String, uEndDate As String) 'collects the code and sum of each code into an array and populates them into the icbr range 'Specifying connections ->> Dim cnn As New ADODB.Connection Dim rst As New ADODB.Recordset 'turn off updates to speed up code execution With Application .ScreenUpdating = False .EnableEvents = False .Calculation = xlCalculationManual .DisplayAlerts = False End With 'Identify the workbook we are using ->> wkb = Application.ThisWorkbook.FullName 'Open connection to the workbook ->> cnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=" & wkb & ";" & _ "Extended Properties=""Excel 12.0;HDR=Yes"";" 'Load the range into a recordset ->> rs.Open "SELECT [Code], Sum([Value]) AS Totals " & _ "From [tbl_cashbook] WHERE ((([Date]) >='" & uStartDate & "' And ([Date]) <='" & uEndDate & "') And (([Details]) =" & Name & ")) " & _ "GROUP BY [Code]", cnn, adOpenStatic If rst.RecordCount > 0 Then rst.MoveFirst i = 0 If IsNull(rst![Code]) Then MsgBox = "Could not detect an records." Else 'collect records into an array containing the code and the sum of each code '----ARRAY GOES HERE End If 'Null test End If 'rs count 'populate the data into the range With wks.icbr 'Populate the array into the workbook range 'Loop here to populate the data 'Start range = icbr_code_start Range("icbr_code_start").Offset(1, 0) = Array(1) Range("icbr_code_start").Offset(1, 3) = Array(1) End With 'release memory rst.Close Set rst = Nothing cnn.Close Set cnn = Nothing 'turn on updates With Application .ScreenUpdating = True .EnableEvents = True .Calculation = xlCalculationAutomatic .DisplayAlerts = True End With End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Excel ActiveX ComboBox enters a 0 if a list item isn't selected||41||45|
|Power Query Grouping By||2||15|
|Help to break down spreadsheet||3||38|
|Excel format formula with percentage||3||5|