VBA Find #N/A value and copy adjacent cells to another sheet and loop
up vote
0
down vote
favorite
Good day to everyone,
I have been trying to find an answer here that would fit my problem but I have been unsuccessful. I am using FIND to search column F for cell with #N/A
value and copy adjacent cells to another "Sheet2" at the end of the column A. I have made the following code that works but my problem is I want to make it to loop to find the next cell with #N/A
value till find all.
Sub Find()
Dim SerchRange As Range
Dim FindCell As Range
Set SerchRange = Range("F:F")
Set FindCell = SerchRange.FIND(What:="#N/A", _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If FindCell Is Nothing Then
MsgBox "Nothing was found all clear"
Else
FindCell.Select
ActiveCell.Offset(0, -3).Resize(, 3).Select
Selection.Copy
Sheets("Sheet2").Select
Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
End If
End Sub
excel vba
add a comment |
up vote
0
down vote
favorite
Good day to everyone,
I have been trying to find an answer here that would fit my problem but I have been unsuccessful. I am using FIND to search column F for cell with #N/A
value and copy adjacent cells to another "Sheet2" at the end of the column A. I have made the following code that works but my problem is I want to make it to loop to find the next cell with #N/A
value till find all.
Sub Find()
Dim SerchRange As Range
Dim FindCell As Range
Set SerchRange = Range("F:F")
Set FindCell = SerchRange.FIND(What:="#N/A", _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If FindCell Is Nothing Then
MsgBox "Nothing was found all clear"
Else
FindCell.Select
ActiveCell.Offset(0, -3).Resize(, 3).Select
Selection.Copy
Sheets("Sheet2").Select
Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
End If
End Sub
excel vba
1
Possible duplicate of Find and FindNext for Excel VBA
– Pᴇʜ
Nov 7 at 9:05
Additionally I recommend to read How to avoid using Select in Excel VBA and apply this technique to your code.
– Pᴇʜ
Nov 7 at 9:06
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Good day to everyone,
I have been trying to find an answer here that would fit my problem but I have been unsuccessful. I am using FIND to search column F for cell with #N/A
value and copy adjacent cells to another "Sheet2" at the end of the column A. I have made the following code that works but my problem is I want to make it to loop to find the next cell with #N/A
value till find all.
Sub Find()
Dim SerchRange As Range
Dim FindCell As Range
Set SerchRange = Range("F:F")
Set FindCell = SerchRange.FIND(What:="#N/A", _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If FindCell Is Nothing Then
MsgBox "Nothing was found all clear"
Else
FindCell.Select
ActiveCell.Offset(0, -3).Resize(, 3).Select
Selection.Copy
Sheets("Sheet2").Select
Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
End If
End Sub
excel vba
Good day to everyone,
I have been trying to find an answer here that would fit my problem but I have been unsuccessful. I am using FIND to search column F for cell with #N/A
value and copy adjacent cells to another "Sheet2" at the end of the column A. I have made the following code that works but my problem is I want to make it to loop to find the next cell with #N/A
value till find all.
Sub Find()
Dim SerchRange As Range
Dim FindCell As Range
Set SerchRange = Range("F:F")
Set FindCell = SerchRange.FIND(What:="#N/A", _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If FindCell Is Nothing Then
MsgBox "Nothing was found all clear"
Else
FindCell.Select
ActiveCell.Offset(0, -3).Resize(, 3).Select
Selection.Copy
Sheets("Sheet2").Select
Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
End If
End Sub
excel vba
excel vba
edited Nov 7 at 9:07
Pᴇʜ
18.6k42549
18.6k42549
asked Nov 7 at 9:04
Vaggelis
1
1
1
Possible duplicate of Find and FindNext for Excel VBA
– Pᴇʜ
Nov 7 at 9:05
Additionally I recommend to read How to avoid using Select in Excel VBA and apply this technique to your code.
– Pᴇʜ
Nov 7 at 9:06
add a comment |
1
Possible duplicate of Find and FindNext for Excel VBA
– Pᴇʜ
Nov 7 at 9:05
Additionally I recommend to read How to avoid using Select in Excel VBA and apply this technique to your code.
– Pᴇʜ
Nov 7 at 9:06
1
1
Possible duplicate of Find and FindNext for Excel VBA
– Pᴇʜ
Nov 7 at 9:05
Possible duplicate of Find and FindNext for Excel VBA
– Pᴇʜ
Nov 7 at 9:05
Additionally I recommend to read How to avoid using Select in Excel VBA and apply this technique to your code.
– Pᴇʜ
Nov 7 at 9:06
Additionally I recommend to read How to avoid using Select in Excel VBA and apply this technique to your code.
– Pᴇʜ
Nov 7 at 9:06
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Try this and let me know if it works:
Option Explicit
Sub Find()
Application.ScreenUpdating = False
Dim SearchRange As Range
Dim FindCell As Range
Dim Check As Boolean
Dim LastRow As Long
Dim ws As Worksheet
Dim ws2 As Worksheet
Dim FindCounter As Long
Set ws = ThisWorkbook.Worksheets("Sheet1") ' <--- Insert the name of your worksheet here
Set ws2 = ThisWorkbook.Worksheets("Sheet2")
LastRow = ws.Cells(Rows.Count, "F").End(xlUp).Row ' <--- Finds the last used row
Set SearchRange = Range("F1:F" & LastRow)
FindCounter = 0
For Each FindCell In SearchRange
If FindCell.Value = "#N/A" Then
FindCounter = FindCounter + 1
FindCell.Offset(0, -3).Resize(, 3).Copy
ws2.Range("A" & ws2.Cells(Rows.Count, "A").End(xlUp).Row + 1).PasteSpecial xlPasteValues
End If
Next
MsgBox "Succes!" & vbNewLine & vbNewLine & "This many cells were found: " & FindCounter
Application.ScreenUpdating = True
End Sub
Thank you very much DirtyDeffy it works!!!!!! The only change I made is to remove “ThisWorbook.” from the two sets. As you understand I am not hard coder but I am trying, my thought was to target the cells with “#N/A” because these cells are 15 or 20 max in a range of 5000 and its time consuming to do it manually…As I understand your code search every cell to much the value “#N/A” am I right?
– Vaggelis
Nov 7 at 12:47
@Vaggelis For a new coder, your idea was nicely thought out. Only a few places in the execution, where it needed improvement.ThisWorkbook
simply specifies which workbook the code needs to target. Yes you are completely right. My version of the code is almost identical to the.Find
method. My version uses a loop to go through column F and if the cell value is "#N/A" then it triggers the copy/paste. I would like you to thoroughly look through my code and ask me if there is anything you don't understand. You only get better at coding if you understand the code you're using :)
– DirtyDeffy
Nov 7 at 13:27
@Vaggelis However in this particular case, using a filter instead of VBA coding might have been easier ;)
– DirtyDeffy
Nov 7 at 13:28
DirtyDeffy I much appreciate your help, your code is very very good and yes I can read it little by little! I thing .Find because this code is a small part of bigger code. I work with huge excel spreadsheets and the code must be efficient, usually 150 000 lines and more! The big code copy data from other two excels in sheet 3 and 4 refresh pivot in sheet 1 now your code find the #N/A copy them to Sheet2 and I have code more to export a report and automate email…! I have many things to learn to code like you! I have many questions about other codes may I ask you about or I must upload question?
– Vaggelis
Nov 7 at 14:28
@Vaggelis Post a new question and link it here as a comment :)
– DirtyDeffy
Nov 8 at 8:33
|
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Try this and let me know if it works:
Option Explicit
Sub Find()
Application.ScreenUpdating = False
Dim SearchRange As Range
Dim FindCell As Range
Dim Check As Boolean
Dim LastRow As Long
Dim ws As Worksheet
Dim ws2 As Worksheet
Dim FindCounter As Long
Set ws = ThisWorkbook.Worksheets("Sheet1") ' <--- Insert the name of your worksheet here
Set ws2 = ThisWorkbook.Worksheets("Sheet2")
LastRow = ws.Cells(Rows.Count, "F").End(xlUp).Row ' <--- Finds the last used row
Set SearchRange = Range("F1:F" & LastRow)
FindCounter = 0
For Each FindCell In SearchRange
If FindCell.Value = "#N/A" Then
FindCounter = FindCounter + 1
FindCell.Offset(0, -3).Resize(, 3).Copy
ws2.Range("A" & ws2.Cells(Rows.Count, "A").End(xlUp).Row + 1).PasteSpecial xlPasteValues
End If
Next
MsgBox "Succes!" & vbNewLine & vbNewLine & "This many cells were found: " & FindCounter
Application.ScreenUpdating = True
End Sub
Thank you very much DirtyDeffy it works!!!!!! The only change I made is to remove “ThisWorbook.” from the two sets. As you understand I am not hard coder but I am trying, my thought was to target the cells with “#N/A” because these cells are 15 or 20 max in a range of 5000 and its time consuming to do it manually…As I understand your code search every cell to much the value “#N/A” am I right?
– Vaggelis
Nov 7 at 12:47
@Vaggelis For a new coder, your idea was nicely thought out. Only a few places in the execution, where it needed improvement.ThisWorkbook
simply specifies which workbook the code needs to target. Yes you are completely right. My version of the code is almost identical to the.Find
method. My version uses a loop to go through column F and if the cell value is "#N/A" then it triggers the copy/paste. I would like you to thoroughly look through my code and ask me if there is anything you don't understand. You only get better at coding if you understand the code you're using :)
– DirtyDeffy
Nov 7 at 13:27
@Vaggelis However in this particular case, using a filter instead of VBA coding might have been easier ;)
– DirtyDeffy
Nov 7 at 13:28
DirtyDeffy I much appreciate your help, your code is very very good and yes I can read it little by little! I thing .Find because this code is a small part of bigger code. I work with huge excel spreadsheets and the code must be efficient, usually 150 000 lines and more! The big code copy data from other two excels in sheet 3 and 4 refresh pivot in sheet 1 now your code find the #N/A copy them to Sheet2 and I have code more to export a report and automate email…! I have many things to learn to code like you! I have many questions about other codes may I ask you about or I must upload question?
– Vaggelis
Nov 7 at 14:28
@Vaggelis Post a new question and link it here as a comment :)
– DirtyDeffy
Nov 8 at 8:33
|
show 1 more comment
up vote
0
down vote
Try this and let me know if it works:
Option Explicit
Sub Find()
Application.ScreenUpdating = False
Dim SearchRange As Range
Dim FindCell As Range
Dim Check As Boolean
Dim LastRow As Long
Dim ws As Worksheet
Dim ws2 As Worksheet
Dim FindCounter As Long
Set ws = ThisWorkbook.Worksheets("Sheet1") ' <--- Insert the name of your worksheet here
Set ws2 = ThisWorkbook.Worksheets("Sheet2")
LastRow = ws.Cells(Rows.Count, "F").End(xlUp).Row ' <--- Finds the last used row
Set SearchRange = Range("F1:F" & LastRow)
FindCounter = 0
For Each FindCell In SearchRange
If FindCell.Value = "#N/A" Then
FindCounter = FindCounter + 1
FindCell.Offset(0, -3).Resize(, 3).Copy
ws2.Range("A" & ws2.Cells(Rows.Count, "A").End(xlUp).Row + 1).PasteSpecial xlPasteValues
End If
Next
MsgBox "Succes!" & vbNewLine & vbNewLine & "This many cells were found: " & FindCounter
Application.ScreenUpdating = True
End Sub
Thank you very much DirtyDeffy it works!!!!!! The only change I made is to remove “ThisWorbook.” from the two sets. As you understand I am not hard coder but I am trying, my thought was to target the cells with “#N/A” because these cells are 15 or 20 max in a range of 5000 and its time consuming to do it manually…As I understand your code search every cell to much the value “#N/A” am I right?
– Vaggelis
Nov 7 at 12:47
@Vaggelis For a new coder, your idea was nicely thought out. Only a few places in the execution, where it needed improvement.ThisWorkbook
simply specifies which workbook the code needs to target. Yes you are completely right. My version of the code is almost identical to the.Find
method. My version uses a loop to go through column F and if the cell value is "#N/A" then it triggers the copy/paste. I would like you to thoroughly look through my code and ask me if there is anything you don't understand. You only get better at coding if you understand the code you're using :)
– DirtyDeffy
Nov 7 at 13:27
@Vaggelis However in this particular case, using a filter instead of VBA coding might have been easier ;)
– DirtyDeffy
Nov 7 at 13:28
DirtyDeffy I much appreciate your help, your code is very very good and yes I can read it little by little! I thing .Find because this code is a small part of bigger code. I work with huge excel spreadsheets and the code must be efficient, usually 150 000 lines and more! The big code copy data from other two excels in sheet 3 and 4 refresh pivot in sheet 1 now your code find the #N/A copy them to Sheet2 and I have code more to export a report and automate email…! I have many things to learn to code like you! I have many questions about other codes may I ask you about or I must upload question?
– Vaggelis
Nov 7 at 14:28
@Vaggelis Post a new question and link it here as a comment :)
– DirtyDeffy
Nov 8 at 8:33
|
show 1 more comment
up vote
0
down vote
up vote
0
down vote
Try this and let me know if it works:
Option Explicit
Sub Find()
Application.ScreenUpdating = False
Dim SearchRange As Range
Dim FindCell As Range
Dim Check As Boolean
Dim LastRow As Long
Dim ws As Worksheet
Dim ws2 As Worksheet
Dim FindCounter As Long
Set ws = ThisWorkbook.Worksheets("Sheet1") ' <--- Insert the name of your worksheet here
Set ws2 = ThisWorkbook.Worksheets("Sheet2")
LastRow = ws.Cells(Rows.Count, "F").End(xlUp).Row ' <--- Finds the last used row
Set SearchRange = Range("F1:F" & LastRow)
FindCounter = 0
For Each FindCell In SearchRange
If FindCell.Value = "#N/A" Then
FindCounter = FindCounter + 1
FindCell.Offset(0, -3).Resize(, 3).Copy
ws2.Range("A" & ws2.Cells(Rows.Count, "A").End(xlUp).Row + 1).PasteSpecial xlPasteValues
End If
Next
MsgBox "Succes!" & vbNewLine & vbNewLine & "This many cells were found: " & FindCounter
Application.ScreenUpdating = True
End Sub
Try this and let me know if it works:
Option Explicit
Sub Find()
Application.ScreenUpdating = False
Dim SearchRange As Range
Dim FindCell As Range
Dim Check As Boolean
Dim LastRow As Long
Dim ws As Worksheet
Dim ws2 As Worksheet
Dim FindCounter As Long
Set ws = ThisWorkbook.Worksheets("Sheet1") ' <--- Insert the name of your worksheet here
Set ws2 = ThisWorkbook.Worksheets("Sheet2")
LastRow = ws.Cells(Rows.Count, "F").End(xlUp).Row ' <--- Finds the last used row
Set SearchRange = Range("F1:F" & LastRow)
FindCounter = 0
For Each FindCell In SearchRange
If FindCell.Value = "#N/A" Then
FindCounter = FindCounter + 1
FindCell.Offset(0, -3).Resize(, 3).Copy
ws2.Range("A" & ws2.Cells(Rows.Count, "A").End(xlUp).Row + 1).PasteSpecial xlPasteValues
End If
Next
MsgBox "Succes!" & vbNewLine & vbNewLine & "This many cells were found: " & FindCounter
Application.ScreenUpdating = True
End Sub
answered Nov 7 at 12:01
DirtyDeffy
3909
3909
Thank you very much DirtyDeffy it works!!!!!! The only change I made is to remove “ThisWorbook.” from the two sets. As you understand I am not hard coder but I am trying, my thought was to target the cells with “#N/A” because these cells are 15 or 20 max in a range of 5000 and its time consuming to do it manually…As I understand your code search every cell to much the value “#N/A” am I right?
– Vaggelis
Nov 7 at 12:47
@Vaggelis For a new coder, your idea was nicely thought out. Only a few places in the execution, where it needed improvement.ThisWorkbook
simply specifies which workbook the code needs to target. Yes you are completely right. My version of the code is almost identical to the.Find
method. My version uses a loop to go through column F and if the cell value is "#N/A" then it triggers the copy/paste. I would like you to thoroughly look through my code and ask me if there is anything you don't understand. You only get better at coding if you understand the code you're using :)
– DirtyDeffy
Nov 7 at 13:27
@Vaggelis However in this particular case, using a filter instead of VBA coding might have been easier ;)
– DirtyDeffy
Nov 7 at 13:28
DirtyDeffy I much appreciate your help, your code is very very good and yes I can read it little by little! I thing .Find because this code is a small part of bigger code. I work with huge excel spreadsheets and the code must be efficient, usually 150 000 lines and more! The big code copy data from other two excels in sheet 3 and 4 refresh pivot in sheet 1 now your code find the #N/A copy them to Sheet2 and I have code more to export a report and automate email…! I have many things to learn to code like you! I have many questions about other codes may I ask you about or I must upload question?
– Vaggelis
Nov 7 at 14:28
@Vaggelis Post a new question and link it here as a comment :)
– DirtyDeffy
Nov 8 at 8:33
|
show 1 more comment
Thank you very much DirtyDeffy it works!!!!!! The only change I made is to remove “ThisWorbook.” from the two sets. As you understand I am not hard coder but I am trying, my thought was to target the cells with “#N/A” because these cells are 15 or 20 max in a range of 5000 and its time consuming to do it manually…As I understand your code search every cell to much the value “#N/A” am I right?
– Vaggelis
Nov 7 at 12:47
@Vaggelis For a new coder, your idea was nicely thought out. Only a few places in the execution, where it needed improvement.ThisWorkbook
simply specifies which workbook the code needs to target. Yes you are completely right. My version of the code is almost identical to the.Find
method. My version uses a loop to go through column F and if the cell value is "#N/A" then it triggers the copy/paste. I would like you to thoroughly look through my code and ask me if there is anything you don't understand. You only get better at coding if you understand the code you're using :)
– DirtyDeffy
Nov 7 at 13:27
@Vaggelis However in this particular case, using a filter instead of VBA coding might have been easier ;)
– DirtyDeffy
Nov 7 at 13:28
DirtyDeffy I much appreciate your help, your code is very very good and yes I can read it little by little! I thing .Find because this code is a small part of bigger code. I work with huge excel spreadsheets and the code must be efficient, usually 150 000 lines and more! The big code copy data from other two excels in sheet 3 and 4 refresh pivot in sheet 1 now your code find the #N/A copy them to Sheet2 and I have code more to export a report and automate email…! I have many things to learn to code like you! I have many questions about other codes may I ask you about or I must upload question?
– Vaggelis
Nov 7 at 14:28
@Vaggelis Post a new question and link it here as a comment :)
– DirtyDeffy
Nov 8 at 8:33
Thank you very much DirtyDeffy it works!!!!!! The only change I made is to remove “ThisWorbook.” from the two sets. As you understand I am not hard coder but I am trying, my thought was to target the cells with “#N/A” because these cells are 15 or 20 max in a range of 5000 and its time consuming to do it manually…As I understand your code search every cell to much the value “#N/A” am I right?
– Vaggelis
Nov 7 at 12:47
Thank you very much DirtyDeffy it works!!!!!! The only change I made is to remove “ThisWorbook.” from the two sets. As you understand I am not hard coder but I am trying, my thought was to target the cells with “#N/A” because these cells are 15 or 20 max in a range of 5000 and its time consuming to do it manually…As I understand your code search every cell to much the value “#N/A” am I right?
– Vaggelis
Nov 7 at 12:47
@Vaggelis For a new coder, your idea was nicely thought out. Only a few places in the execution, where it needed improvement.
ThisWorkbook
simply specifies which workbook the code needs to target. Yes you are completely right. My version of the code is almost identical to the .Find
method. My version uses a loop to go through column F and if the cell value is "#N/A" then it triggers the copy/paste. I would like you to thoroughly look through my code and ask me if there is anything you don't understand. You only get better at coding if you understand the code you're using :)– DirtyDeffy
Nov 7 at 13:27
@Vaggelis For a new coder, your idea was nicely thought out. Only a few places in the execution, where it needed improvement.
ThisWorkbook
simply specifies which workbook the code needs to target. Yes you are completely right. My version of the code is almost identical to the .Find
method. My version uses a loop to go through column F and if the cell value is "#N/A" then it triggers the copy/paste. I would like you to thoroughly look through my code and ask me if there is anything you don't understand. You only get better at coding if you understand the code you're using :)– DirtyDeffy
Nov 7 at 13:27
@Vaggelis However in this particular case, using a filter instead of VBA coding might have been easier ;)
– DirtyDeffy
Nov 7 at 13:28
@Vaggelis However in this particular case, using a filter instead of VBA coding might have been easier ;)
– DirtyDeffy
Nov 7 at 13:28
DirtyDeffy I much appreciate your help, your code is very very good and yes I can read it little by little! I thing .Find because this code is a small part of bigger code. I work with huge excel spreadsheets and the code must be efficient, usually 150 000 lines and more! The big code copy data from other two excels in sheet 3 and 4 refresh pivot in sheet 1 now your code find the #N/A copy them to Sheet2 and I have code more to export a report and automate email…! I have many things to learn to code like you! I have many questions about other codes may I ask you about or I must upload question?
– Vaggelis
Nov 7 at 14:28
DirtyDeffy I much appreciate your help, your code is very very good and yes I can read it little by little! I thing .Find because this code is a small part of bigger code. I work with huge excel spreadsheets and the code must be efficient, usually 150 000 lines and more! The big code copy data from other two excels in sheet 3 and 4 refresh pivot in sheet 1 now your code find the #N/A copy them to Sheet2 and I have code more to export a report and automate email…! I have many things to learn to code like you! I have many questions about other codes may I ask you about or I must upload question?
– Vaggelis
Nov 7 at 14:28
@Vaggelis Post a new question and link it here as a comment :)
– DirtyDeffy
Nov 8 at 8:33
@Vaggelis Post a new question and link it here as a comment :)
– DirtyDeffy
Nov 8 at 8:33
|
show 1 more comment
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%2f53186288%2fvba-find-n-a-value-and-copy-adjacent-cells-to-another-sheet-and-loop%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
1
Possible duplicate of Find and FindNext for Excel VBA
– Pᴇʜ
Nov 7 at 9:05
Additionally I recommend to read How to avoid using Select in Excel VBA and apply this technique to your code.
– Pᴇʜ
Nov 7 at 9:06