How Can I Speed Up An ADODB ConnectionHow can I prevent SQL injection in PHP?How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office?How do I connect to a MySQL Database in Python?How to get a list of user accounts using the command line in MySQL?How to add excel range as a picture to outlook message bodyHow do I import an SQL file using the command line in MySQL?excel replace function in access vbaFastest way for duplicates remove in Access DBFollowed the standard way but failed to click a object in a web page with VBAExcel VBA macro to send emails to unique users in range
All over the place
Caro-Kann c4-c5 push
Did Tolkien ever write about a Heaven or Hell for Men?
How to say "respectively" in German when listing (enumerating) things
Enlightenment finding me
As a team leader is it appropriate to bring in fundraiser candy?
Wondering why they used ultrafast diodes in a 50 or 60Hz bridge?
Can a passenger predict that an airline or a tour operator is about to go bankrupt?
Job interview by video at home and privacy concerns
A word that refers to saying something in an attempt to anger or embarrass someone into doing something that they don’t want to do?
Is the "spacetime" the same thing as the mathematical 4th dimension?
How to transcribe an arpeggiated 4-note chord to be playable on a violin?
Can an untrusted VPN client monitor my network activity?
Can I cast Death Ward on additional creatures without causing previous castings to end?
How important is knowledge of trig identities for use in Calculus
Why such a singular place for bird watching?
Meaning of "fin" in "fin dai tempi"
French license plates
Duck, duck, gone!
Disable all sound permanently
Why aren't faces sharp in my f/1.8 portraits even though I'm carefully using center-point autofocus?
Approximate the perfect fifth
MaxCounters solution in C# from Codility
Does Bank Manager's discretion still exist in Mortgage Lending
How Can I Speed Up An ADODB Connection
How can I prevent SQL injection in PHP?How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office?How do I connect to a MySQL Database in Python?How to get a list of user accounts using the command line in MySQL?How to add excel range as a picture to outlook message bodyHow do I import an SQL file using the command line in MySQL?excel replace function in access vbaFastest way for duplicates remove in Access DBFollowed the standard way but failed to click a object in a web page with VBAExcel VBA macro to send emails to unique users in range
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I am running the code below to retrieve data from my Access Database into Excel. The code takes about 1 minute to execute. There are currently about 500 records with 8 columns. Is there anything I can do to modify my code to run faster?
Sub sync_Data()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Dim cn As ADODB.Connection, rs As ADODB.Recordset
Dim mysqlSt As String
Dim rowindex As Long
mysqlSt = "SELECT pbsclients.client, pbsclients.priority, pbsclients.source, pbsclients.lastcontact, pbsclients.result, pbsclients.nextsteps, pbsclients.attempts, pbsclients.notes FROM pbsclients; "
Set cn = New ADODB.Connection
With cn
.ConnectionString = con1
.Open
End With
rowindex = 2
Set rs = New ADODB.Recordset
rs.Open mysqlSt, cn, adOpenDynamic, adLockOptimistic
While Not rs.EOF
Sheet3.Cells(rowindex, 1) = rs!client
Sheet3.Cells(rowindex, 2) = rs!Priority
Sheet3.Cells(rowindex, 3) = rs!Source
Sheet3.Cells(rowindex, 4) = rs!lastcontact
Sheet3.Cells(rowindex, 5) = rs!result
Sheet3.Cells(rowindex, 6) = rs!nextsteps
Sheet3.Cells(rowindex, 7) = rs!attempts
Sheet3.Cells(rowindex, 8) = rs!Notes
rowindex = rowindex + 1
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
Exit Sub
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
mysql excel vba ms-access access-vba
|
show 9 more comments
I am running the code below to retrieve data from my Access Database into Excel. The code takes about 1 minute to execute. There are currently about 500 records with 8 columns. Is there anything I can do to modify my code to run faster?
Sub sync_Data()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Dim cn As ADODB.Connection, rs As ADODB.Recordset
Dim mysqlSt As String
Dim rowindex As Long
mysqlSt = "SELECT pbsclients.client, pbsclients.priority, pbsclients.source, pbsclients.lastcontact, pbsclients.result, pbsclients.nextsteps, pbsclients.attempts, pbsclients.notes FROM pbsclients; "
Set cn = New ADODB.Connection
With cn
.ConnectionString = con1
.Open
End With
rowindex = 2
Set rs = New ADODB.Recordset
rs.Open mysqlSt, cn, adOpenDynamic, adLockOptimistic
While Not rs.EOF
Sheet3.Cells(rowindex, 1) = rs!client
Sheet3.Cells(rowindex, 2) = rs!Priority
Sheet3.Cells(rowindex, 3) = rs!Source
Sheet3.Cells(rowindex, 4) = rs!lastcontact
Sheet3.Cells(rowindex, 5) = rs!result
Sheet3.Cells(rowindex, 6) = rs!nextsteps
Sheet3.Cells(rowindex, 7) = rs!attempts
Sheet3.Cells(rowindex, 8) = rs!Notes
rowindex = rowindex + 1
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
Exit Sub
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
mysql excel vba ms-access access-vba
4
TryRange.CopyFromRecordset
.
– GSerg
Mar 28 at 20:44
2
Instead of everything betweenWhile Not rs.EOF
andWend
.
– GSerg
Mar 28 at 21:10
1
Instead of the entireWhile...Wend
block, actually. FWIWWhile...Wend
is an obsolete construct, should beDo While...Loop
to allow forExit Do
statements.
– Mathieu Guindon
Mar 28 at 21:11
1
You need to hit the index somehow... tryWHERE Id <> 0
(assuming a single-column, autonumber PK)
– Mathieu Guindon
Mar 28 at 21:24
2
Try it. Assuming employee is a text field:WHERE ID <> 0 AND employee ='" & sheet3.range("D5") & "'"
– June7
Mar 28 at 21:38
|
show 9 more comments
I am running the code below to retrieve data from my Access Database into Excel. The code takes about 1 minute to execute. There are currently about 500 records with 8 columns. Is there anything I can do to modify my code to run faster?
Sub sync_Data()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Dim cn As ADODB.Connection, rs As ADODB.Recordset
Dim mysqlSt As String
Dim rowindex As Long
mysqlSt = "SELECT pbsclients.client, pbsclients.priority, pbsclients.source, pbsclients.lastcontact, pbsclients.result, pbsclients.nextsteps, pbsclients.attempts, pbsclients.notes FROM pbsclients; "
Set cn = New ADODB.Connection
With cn
.ConnectionString = con1
.Open
End With
rowindex = 2
Set rs = New ADODB.Recordset
rs.Open mysqlSt, cn, adOpenDynamic, adLockOptimistic
While Not rs.EOF
Sheet3.Cells(rowindex, 1) = rs!client
Sheet3.Cells(rowindex, 2) = rs!Priority
Sheet3.Cells(rowindex, 3) = rs!Source
Sheet3.Cells(rowindex, 4) = rs!lastcontact
Sheet3.Cells(rowindex, 5) = rs!result
Sheet3.Cells(rowindex, 6) = rs!nextsteps
Sheet3.Cells(rowindex, 7) = rs!attempts
Sheet3.Cells(rowindex, 8) = rs!Notes
rowindex = rowindex + 1
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
Exit Sub
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
mysql excel vba ms-access access-vba
I am running the code below to retrieve data from my Access Database into Excel. The code takes about 1 minute to execute. There are currently about 500 records with 8 columns. Is there anything I can do to modify my code to run faster?
Sub sync_Data()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Dim cn As ADODB.Connection, rs As ADODB.Recordset
Dim mysqlSt As String
Dim rowindex As Long
mysqlSt = "SELECT pbsclients.client, pbsclients.priority, pbsclients.source, pbsclients.lastcontact, pbsclients.result, pbsclients.nextsteps, pbsclients.attempts, pbsclients.notes FROM pbsclients; "
Set cn = New ADODB.Connection
With cn
.ConnectionString = con1
.Open
End With
rowindex = 2
Set rs = New ADODB.Recordset
rs.Open mysqlSt, cn, adOpenDynamic, adLockOptimistic
While Not rs.EOF
Sheet3.Cells(rowindex, 1) = rs!client
Sheet3.Cells(rowindex, 2) = rs!Priority
Sheet3.Cells(rowindex, 3) = rs!Source
Sheet3.Cells(rowindex, 4) = rs!lastcontact
Sheet3.Cells(rowindex, 5) = rs!result
Sheet3.Cells(rowindex, 6) = rs!nextsteps
Sheet3.Cells(rowindex, 7) = rs!attempts
Sheet3.Cells(rowindex, 8) = rs!Notes
rowindex = rowindex + 1
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
Exit Sub
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
mysql excel vba ms-access access-vba
mysql excel vba ms-access access-vba
edited Mar 28 at 20:43
GSerg
63.2k15 gold badges117 silver badges256 bronze badges
63.2k15 gold badges117 silver badges256 bronze badges
asked Mar 28 at 20:39
JoseJose
1148 bronze badges
1148 bronze badges
4
TryRange.CopyFromRecordset
.
– GSerg
Mar 28 at 20:44
2
Instead of everything betweenWhile Not rs.EOF
andWend
.
– GSerg
Mar 28 at 21:10
1
Instead of the entireWhile...Wend
block, actually. FWIWWhile...Wend
is an obsolete construct, should beDo While...Loop
to allow forExit Do
statements.
– Mathieu Guindon
Mar 28 at 21:11
1
You need to hit the index somehow... tryWHERE Id <> 0
(assuming a single-column, autonumber PK)
– Mathieu Guindon
Mar 28 at 21:24
2
Try it. Assuming employee is a text field:WHERE ID <> 0 AND employee ='" & sheet3.range("D5") & "'"
– June7
Mar 28 at 21:38
|
show 9 more comments
4
TryRange.CopyFromRecordset
.
– GSerg
Mar 28 at 20:44
2
Instead of everything betweenWhile Not rs.EOF
andWend
.
– GSerg
Mar 28 at 21:10
1
Instead of the entireWhile...Wend
block, actually. FWIWWhile...Wend
is an obsolete construct, should beDo While...Loop
to allow forExit Do
statements.
– Mathieu Guindon
Mar 28 at 21:11
1
You need to hit the index somehow... tryWHERE Id <> 0
(assuming a single-column, autonumber PK)
– Mathieu Guindon
Mar 28 at 21:24
2
Try it. Assuming employee is a text field:WHERE ID <> 0 AND employee ='" & sheet3.range("D5") & "'"
– June7
Mar 28 at 21:38
4
4
Try
Range.CopyFromRecordset
.– GSerg
Mar 28 at 20:44
Try
Range.CopyFromRecordset
.– GSerg
Mar 28 at 20:44
2
2
Instead of everything between
While Not rs.EOF
and Wend
.– GSerg
Mar 28 at 21:10
Instead of everything between
While Not rs.EOF
and Wend
.– GSerg
Mar 28 at 21:10
1
1
Instead of the entire
While...Wend
block, actually. FWIW While...Wend
is an obsolete construct, should be Do While...Loop
to allow for Exit Do
statements.– Mathieu Guindon
Mar 28 at 21:11
Instead of the entire
While...Wend
block, actually. FWIW While...Wend
is an obsolete construct, should be Do While...Loop
to allow for Exit Do
statements.– Mathieu Guindon
Mar 28 at 21:11
1
1
You need to hit the index somehow... try
WHERE Id <> 0
(assuming a single-column, autonumber PK)– Mathieu Guindon
Mar 28 at 21:24
You need to hit the index somehow... try
WHERE Id <> 0
(assuming a single-column, autonumber PK)– Mathieu Guindon
Mar 28 at 21:24
2
2
Try it. Assuming employee is a text field:
WHERE ID <> 0 AND employee ='" & sheet3.range("D5") & "'"
– June7
Mar 28 at 21:38
Try it. Assuming employee is a text field:
WHERE ID <> 0 AND employee ='" & sheet3.range("D5") & "'"
– June7
Mar 28 at 21:38
|
show 9 more comments
1 Answer
1
active
oldest
votes
Here is the working version of my code, takes about 2 seconds to run and retrieve vs 45 seconds - 1 minute with my above code.
Sub sync_Data()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Dim cn As ADODB.Connection, rs As ADODB.Recordset
Dim mysqlSt As String
Dim rowindex As Long
mysqlSt = "SELECT pbsclients.client, pbsclients.priority, pbsclients.source, pbsclients.lastcontact, pbsclients.result, pbsclients.nextsteps, pbsclients.attempts, pbsclients.notes FROM pbsclients WHERE Id <> 0 AND pbsclients.branch = '" & Sheet3.Range("Z1") & "'"
Set cn = New ADODB.Connection
With cn
.ConnectionString = con1
.Open
End With
rowindex = 2
Set rs = New ADODB.Recordset
rs.Open mysqlSt, cn, adOpenDynamic, adLockOptimistic
Do While Not rs.EOF
Sheet3.Range("A2").CopyFromRecordset rs
Loop
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
Exit Sub
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
2
And you can make your code more clear by removing theDo While Not rs.EOF
+Loop
surrounding your.CopyFromRecordset rs
.
– FXD
Mar 28 at 23:42
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406495%2fhow-can-i-speed-up-an-adodb-connection%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here is the working version of my code, takes about 2 seconds to run and retrieve vs 45 seconds - 1 minute with my above code.
Sub sync_Data()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Dim cn As ADODB.Connection, rs As ADODB.Recordset
Dim mysqlSt As String
Dim rowindex As Long
mysqlSt = "SELECT pbsclients.client, pbsclients.priority, pbsclients.source, pbsclients.lastcontact, pbsclients.result, pbsclients.nextsteps, pbsclients.attempts, pbsclients.notes FROM pbsclients WHERE Id <> 0 AND pbsclients.branch = '" & Sheet3.Range("Z1") & "'"
Set cn = New ADODB.Connection
With cn
.ConnectionString = con1
.Open
End With
rowindex = 2
Set rs = New ADODB.Recordset
rs.Open mysqlSt, cn, adOpenDynamic, adLockOptimistic
Do While Not rs.EOF
Sheet3.Range("A2").CopyFromRecordset rs
Loop
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
Exit Sub
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
2
And you can make your code more clear by removing theDo While Not rs.EOF
+Loop
surrounding your.CopyFromRecordset rs
.
– FXD
Mar 28 at 23:42
add a comment
|
Here is the working version of my code, takes about 2 seconds to run and retrieve vs 45 seconds - 1 minute with my above code.
Sub sync_Data()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Dim cn As ADODB.Connection, rs As ADODB.Recordset
Dim mysqlSt As String
Dim rowindex As Long
mysqlSt = "SELECT pbsclients.client, pbsclients.priority, pbsclients.source, pbsclients.lastcontact, pbsclients.result, pbsclients.nextsteps, pbsclients.attempts, pbsclients.notes FROM pbsclients WHERE Id <> 0 AND pbsclients.branch = '" & Sheet3.Range("Z1") & "'"
Set cn = New ADODB.Connection
With cn
.ConnectionString = con1
.Open
End With
rowindex = 2
Set rs = New ADODB.Recordset
rs.Open mysqlSt, cn, adOpenDynamic, adLockOptimistic
Do While Not rs.EOF
Sheet3.Range("A2").CopyFromRecordset rs
Loop
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
Exit Sub
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
2
And you can make your code more clear by removing theDo While Not rs.EOF
+Loop
surrounding your.CopyFromRecordset rs
.
– FXD
Mar 28 at 23:42
add a comment
|
Here is the working version of my code, takes about 2 seconds to run and retrieve vs 45 seconds - 1 minute with my above code.
Sub sync_Data()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Dim cn As ADODB.Connection, rs As ADODB.Recordset
Dim mysqlSt As String
Dim rowindex As Long
mysqlSt = "SELECT pbsclients.client, pbsclients.priority, pbsclients.source, pbsclients.lastcontact, pbsclients.result, pbsclients.nextsteps, pbsclients.attempts, pbsclients.notes FROM pbsclients WHERE Id <> 0 AND pbsclients.branch = '" & Sheet3.Range("Z1") & "'"
Set cn = New ADODB.Connection
With cn
.ConnectionString = con1
.Open
End With
rowindex = 2
Set rs = New ADODB.Recordset
rs.Open mysqlSt, cn, adOpenDynamic, adLockOptimistic
Do While Not rs.EOF
Sheet3.Range("A2").CopyFromRecordset rs
Loop
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
Exit Sub
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
Here is the working version of my code, takes about 2 seconds to run and retrieve vs 45 seconds - 1 minute with my above code.
Sub sync_Data()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Dim cn As ADODB.Connection, rs As ADODB.Recordset
Dim mysqlSt As String
Dim rowindex As Long
mysqlSt = "SELECT pbsclients.client, pbsclients.priority, pbsclients.source, pbsclients.lastcontact, pbsclients.result, pbsclients.nextsteps, pbsclients.attempts, pbsclients.notes FROM pbsclients WHERE Id <> 0 AND pbsclients.branch = '" & Sheet3.Range("Z1") & "'"
Set cn = New ADODB.Connection
With cn
.ConnectionString = con1
.Open
End With
rowindex = 2
Set rs = New ADODB.Recordset
rs.Open mysqlSt, cn, adOpenDynamic, adLockOptimistic
Do While Not rs.EOF
Sheet3.Range("A2").CopyFromRecordset rs
Loop
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
Exit Sub
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
edited Mar 30 at 21:21
TylerH
16.6k10 gold badges57 silver badges72 bronze badges
16.6k10 gold badges57 silver badges72 bronze badges
answered Mar 28 at 21:52
JoseJose
1148 bronze badges
1148 bronze badges
2
And you can make your code more clear by removing theDo While Not rs.EOF
+Loop
surrounding your.CopyFromRecordset rs
.
– FXD
Mar 28 at 23:42
add a comment
|
2
And you can make your code more clear by removing theDo While Not rs.EOF
+Loop
surrounding your.CopyFromRecordset rs
.
– FXD
Mar 28 at 23:42
2
2
And you can make your code more clear by removing the
Do While Not rs.EOF
+ Loop
surrounding your .CopyFromRecordset rs
.– FXD
Mar 28 at 23:42
And you can make your code more clear by removing the
Do While Not rs.EOF
+ Loop
surrounding your .CopyFromRecordset rs
.– FXD
Mar 28 at 23:42
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406495%2fhow-can-i-speed-up-an-adodb-connection%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
4
Try
Range.CopyFromRecordset
.– GSerg
Mar 28 at 20:44
2
Instead of everything between
While Not rs.EOF
andWend
.– GSerg
Mar 28 at 21:10
1
Instead of the entire
While...Wend
block, actually. FWIWWhile...Wend
is an obsolete construct, should beDo While...Loop
to allow forExit Do
statements.– Mathieu Guindon
Mar 28 at 21:11
1
You need to hit the index somehow... try
WHERE Id <> 0
(assuming a single-column, autonumber PK)– Mathieu Guindon
Mar 28 at 21:24
2
Try it. Assuming employee is a text field:
WHERE ID <> 0 AND employee ='" & sheet3.range("D5") & "'"
– June7
Mar 28 at 21:38