Name Sheets Based on Array Value Then Copy Rows From Range With Same Value as Sheet NameAuto create Excel sheets from Array valuesFiltering multiple criteria into separate worksheetsVBA- search sheet name from range.. then copy from range sheet, paste transpose into that sheetnameCopy Range From One Sheet Paste Part of Range In Same Sheet Based On Cell Value On Another SheetFor loop to copy entire row when match found between two sheetsCopying range of cells from workbooks based on sheetnameUsing an array for unique copy from multiple sheets / VBATake the date in one worksheet and find the same date in another worksheet column and return the cell reference for that date to use in a loopVBA code to copy row data from one sheet to existing sheet with same same as reference celllooping through sheets to copy value in a certain range to another sheetHow can I write different information to cells on varying number of sheets from a named range on a summary sheetHow can I copy range from sheet to sheet based on column value?Add rows based on cell value
How would an order of Monks that renounce their names communicate effectively?
Sharing referee/AE report online to point out a grievous error in refereeing
Can I travel from Germany to England alone as an unaccompanied minor?
My colleague is constantly blaming me for his errors
Most elegant way to write a one shot IF
Verifiable delay functions vs Proof of Sequential Work
Why is Japan trying to have a better relationship with Iran?
How is this practical and very old scene shot?
Is there a legal way for US presidents to extend their terms beyond four years?
Skipping over failed imports until they are needed (if ever)
Golf the smallest circle!
Should I share with a new service provider a bill from its competitor?
What's the safest way to inform a new user of their password on an invite-only website?
What's the rule for a natural 20 on a Perception check?
Who voices the character "Finger" in The Fifth Element?
Why is copy constructor called instead of move constructor when returning?
Could the Q destroy the universe?
Wrong corporate name on employment agreement
Ordered list of OR journals
Movie with Zoltar, a trailer park named Paradise and a boy playing a video game and being recruited by aliens to fight in space
Are these intended activities legal to do in the USA under the VWP?
Create custom script for send mail in magento 1.9
Details of video memory access arbitration in Space Invaders
What could a reptilian race tell by candling their eggs?
Name Sheets Based on Array Value Then Copy Rows From Range With Same Value as Sheet Name
Auto create Excel sheets from Array valuesFiltering multiple criteria into separate worksheetsVBA- search sheet name from range.. then copy from range sheet, paste transpose into that sheetnameCopy Range From One Sheet Paste Part of Range In Same Sheet Based On Cell Value On Another SheetFor loop to copy entire row when match found between two sheetsCopying range of cells from workbooks based on sheetnameUsing an array for unique copy from multiple sheets / VBATake the date in one worksheet and find the same date in another worksheet column and return the cell reference for that date to use in a loopVBA code to copy row data from one sheet to existing sheet with same same as reference celllooping through sheets to copy value in a certain range to another sheetHow can I write different information to cells on varying number of sheets from a named range on a summary sheetHow can I copy range from sheet to sheet based on column value?Add rows based on cell value
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a table that I need to do the following with:
- Get the range of the fk_keyword column
- Loop through the range and identify only unique values
- Loop through the unique values and create sheets with the name of the unique values
- Loop through the original range (fk_keyword) and copy the entire row to the sheet with the matching name
For example: If the value found in fk_keyword matches the name of a sheet, then for all the cells that meet the same criteria, their entire row must be copied to that sheet.
I found a few similar questions, however, they all seem to be slightly different to my query, in that I am having different issues..
The closest match to my question I found is here:
VBA- search sheet name from range.. then copy from range sheet, paste transpose into that sheetname
Even though I found this, I am not using the code in this example.
Instead, I have received the help up to this point from these links:
Copy Entire Row to New Sheet:
https://www.extendoffice.com/documents/excel/3723-excel-move-row-to-another-sheet-based-on-cell-value.html
Create Sheets from Excel Cell Value:
Auto create Excel sheets from Array values
Remove Duplicates from Array:
https://wellsr.com/vba/2017/excel/vba-remove-duplicates-from-array/
So here is the code I have at the moment:
Functions:
move_Data_To_Sheet
Function move_Data_To_Sheet(myArray As Variant)
'Dim variables
Dim xRg As Range, xCell
Dim I As Long, J, K, Counter
Dim tmpltWkbk As Workbook
Dim ws1 As Worksheet
'Set variables
Set xRg = find_Header("fk_keyword")
Set tmpltWkbk = Workbooks("New DB.xlsm")
Set ws1 = tmpltWkbk.Sheets("TableSheet")
'Get the row count of the primary sheet
I = ws1.UsedRange.Rows.Count
Counter = 0
'loop through each element in my array
For Each c In myArray
'Check that that element is not empty
If c <> "" Then
'Add a new sheet after the active sheet
Sheets.Add After:=ActiveSheet
'Name the new sheet the same as the current element name in the array
ActiveSheet.Name = c
'Get the row count of the new sheet
J = Worksheets(c).UsedRange.Rows.Count
'Check if the value is 1
If J = 1 Then
'Check if the value is 0
If Application.WorksheetFunction.CountA(Worksheets(c).UsedRange) = 0 Then
'J is actually empty
J = 0
End If
End If
'Loop through the specific range (fk_keyword) on the primary sheet
For K = 1 To xRg.Count
'Check if the element matches the current element in the first array
If CStr(xRg(K).Value) = c Then
'Copy the entire row from the primary sheet to the newly added sheet
xRg(K).EntireRow.Copy Destination:=Worksheets(c).Range("A" & J + 1)
'Delete the row from the primary sheet
xRg(K).EntireRow.Delete
'Increment J
J = J + 1
'Increment the counter
Counter = Counter + 1
End If
'Next element in the array
Next
End If
'Next element in the array
Next c
End Function
Below is the issue I am experiencing.
When the data is copied to the new sheets based on the Cell value (KW ID), it seems to only copy some of the data and not all of it.
For Example, in the image below are the totals for the numeric values found under the fk_keyword column in my sheet. These numeric values are KW ID's and the totals are how many times they appear in the fk_keyword column.

Now when I copy the data to the new sheets, instead of having all the data copied, it will copy something like this:
- For KW ID 5: 11 Rows
- For KW ID 9: 15 Rows
- For KW ID 10: 13 Rows
And so on. But not a single KW ID, with all its rows were copied and I cannot understand why.
excel vba
|
show 1 more comment
I have a table that I need to do the following with:
- Get the range of the fk_keyword column
- Loop through the range and identify only unique values
- Loop through the unique values and create sheets with the name of the unique values
- Loop through the original range (fk_keyword) and copy the entire row to the sheet with the matching name
For example: If the value found in fk_keyword matches the name of a sheet, then for all the cells that meet the same criteria, their entire row must be copied to that sheet.
I found a few similar questions, however, they all seem to be slightly different to my query, in that I am having different issues..
The closest match to my question I found is here:
VBA- search sheet name from range.. then copy from range sheet, paste transpose into that sheetname
Even though I found this, I am not using the code in this example.
Instead, I have received the help up to this point from these links:
Copy Entire Row to New Sheet:
https://www.extendoffice.com/documents/excel/3723-excel-move-row-to-another-sheet-based-on-cell-value.html
Create Sheets from Excel Cell Value:
Auto create Excel sheets from Array values
Remove Duplicates from Array:
https://wellsr.com/vba/2017/excel/vba-remove-duplicates-from-array/
So here is the code I have at the moment:
Functions:
move_Data_To_Sheet
Function move_Data_To_Sheet(myArray As Variant)
'Dim variables
Dim xRg As Range, xCell
Dim I As Long, J, K, Counter
Dim tmpltWkbk As Workbook
Dim ws1 As Worksheet
'Set variables
Set xRg = find_Header("fk_keyword")
Set tmpltWkbk = Workbooks("New DB.xlsm")
Set ws1 = tmpltWkbk.Sheets("TableSheet")
'Get the row count of the primary sheet
I = ws1.UsedRange.Rows.Count
Counter = 0
'loop through each element in my array
For Each c In myArray
'Check that that element is not empty
If c <> "" Then
'Add a new sheet after the active sheet
Sheets.Add After:=ActiveSheet
'Name the new sheet the same as the current element name in the array
ActiveSheet.Name = c
'Get the row count of the new sheet
J = Worksheets(c).UsedRange.Rows.Count
'Check if the value is 1
If J = 1 Then
'Check if the value is 0
If Application.WorksheetFunction.CountA(Worksheets(c).UsedRange) = 0 Then
'J is actually empty
J = 0
End If
End If
'Loop through the specific range (fk_keyword) on the primary sheet
For K = 1 To xRg.Count
'Check if the element matches the current element in the first array
If CStr(xRg(K).Value) = c Then
'Copy the entire row from the primary sheet to the newly added sheet
xRg(K).EntireRow.Copy Destination:=Worksheets(c).Range("A" & J + 1)
'Delete the row from the primary sheet
xRg(K).EntireRow.Delete
'Increment J
J = J + 1
'Increment the counter
Counter = Counter + 1
End If
'Next element in the array
Next
End If
'Next element in the array
Next c
End Function
Below is the issue I am experiencing.
When the data is copied to the new sheets based on the Cell value (KW ID), it seems to only copy some of the data and not all of it.
For Example, in the image below are the totals for the numeric values found under the fk_keyword column in my sheet. These numeric values are KW ID's and the totals are how many times they appear in the fk_keyword column.

Now when I copy the data to the new sheets, instead of having all the data copied, it will copy something like this:
- For KW ID 5: 11 Rows
- For KW ID 9: 15 Rows
- For KW ID 10: 13 Rows
And so on. But not a single KW ID, with all its rows were copied and I cannot understand why.
excel vba
I believe you should have a look at this: stackoverflow.com/help/mcve
– user2261597
Mar 25 at 13:53
A note on the errors you identified: thearrColvariable is a collection. I don't believe a collection lets you check what values already exist in it (and some entries end up read-only, data type dependent). An informative link on collections: excelmacromastery.com/excel-vba-collections A link on Dictionaries (which have an.Existsmethod, but require either a reference or late-binding): excelmacromastery.com/vba-dictionary
– Mistella
Mar 25 at 13:58
@peakpeak Thank you for the reply. I do apologize for the long post, I just don't know how to shorten it.. If I leave out functions, then I will surely get asked to see the code. And on numerous posts I have been asked about removingOn Error Resume Nextso I just included it in the post.
– Eitel Dagnin
Mar 25 at 14:08
@Mistella Thank you for the reply, I will read up on the links provided and possibly look into changing the collection to a dictionary instead :)
– Eitel Dagnin
Mar 25 at 14:08
@peakpeak Okay, I have shortened it to only the function that does the copying now. :)
– Eitel Dagnin
Mar 25 at 14:23
|
show 1 more comment
I have a table that I need to do the following with:
- Get the range of the fk_keyword column
- Loop through the range and identify only unique values
- Loop through the unique values and create sheets with the name of the unique values
- Loop through the original range (fk_keyword) and copy the entire row to the sheet with the matching name
For example: If the value found in fk_keyword matches the name of a sheet, then for all the cells that meet the same criteria, their entire row must be copied to that sheet.
I found a few similar questions, however, they all seem to be slightly different to my query, in that I am having different issues..
The closest match to my question I found is here:
VBA- search sheet name from range.. then copy from range sheet, paste transpose into that sheetname
Even though I found this, I am not using the code in this example.
Instead, I have received the help up to this point from these links:
Copy Entire Row to New Sheet:
https://www.extendoffice.com/documents/excel/3723-excel-move-row-to-another-sheet-based-on-cell-value.html
Create Sheets from Excel Cell Value:
Auto create Excel sheets from Array values
Remove Duplicates from Array:
https://wellsr.com/vba/2017/excel/vba-remove-duplicates-from-array/
So here is the code I have at the moment:
Functions:
move_Data_To_Sheet
Function move_Data_To_Sheet(myArray As Variant)
'Dim variables
Dim xRg As Range, xCell
Dim I As Long, J, K, Counter
Dim tmpltWkbk As Workbook
Dim ws1 As Worksheet
'Set variables
Set xRg = find_Header("fk_keyword")
Set tmpltWkbk = Workbooks("New DB.xlsm")
Set ws1 = tmpltWkbk.Sheets("TableSheet")
'Get the row count of the primary sheet
I = ws1.UsedRange.Rows.Count
Counter = 0
'loop through each element in my array
For Each c In myArray
'Check that that element is not empty
If c <> "" Then
'Add a new sheet after the active sheet
Sheets.Add After:=ActiveSheet
'Name the new sheet the same as the current element name in the array
ActiveSheet.Name = c
'Get the row count of the new sheet
J = Worksheets(c).UsedRange.Rows.Count
'Check if the value is 1
If J = 1 Then
'Check if the value is 0
If Application.WorksheetFunction.CountA(Worksheets(c).UsedRange) = 0 Then
'J is actually empty
J = 0
End If
End If
'Loop through the specific range (fk_keyword) on the primary sheet
For K = 1 To xRg.Count
'Check if the element matches the current element in the first array
If CStr(xRg(K).Value) = c Then
'Copy the entire row from the primary sheet to the newly added sheet
xRg(K).EntireRow.Copy Destination:=Worksheets(c).Range("A" & J + 1)
'Delete the row from the primary sheet
xRg(K).EntireRow.Delete
'Increment J
J = J + 1
'Increment the counter
Counter = Counter + 1
End If
'Next element in the array
Next
End If
'Next element in the array
Next c
End Function
Below is the issue I am experiencing.
When the data is copied to the new sheets based on the Cell value (KW ID), it seems to only copy some of the data and not all of it.
For Example, in the image below are the totals for the numeric values found under the fk_keyword column in my sheet. These numeric values are KW ID's and the totals are how many times they appear in the fk_keyword column.

Now when I copy the data to the new sheets, instead of having all the data copied, it will copy something like this:
- For KW ID 5: 11 Rows
- For KW ID 9: 15 Rows
- For KW ID 10: 13 Rows
And so on. But not a single KW ID, with all its rows were copied and I cannot understand why.
excel vba
I have a table that I need to do the following with:
- Get the range of the fk_keyword column
- Loop through the range and identify only unique values
- Loop through the unique values and create sheets with the name of the unique values
- Loop through the original range (fk_keyword) and copy the entire row to the sheet with the matching name
For example: If the value found in fk_keyword matches the name of a sheet, then for all the cells that meet the same criteria, their entire row must be copied to that sheet.
I found a few similar questions, however, they all seem to be slightly different to my query, in that I am having different issues..
The closest match to my question I found is here:
VBA- search sheet name from range.. then copy from range sheet, paste transpose into that sheetname
Even though I found this, I am not using the code in this example.
Instead, I have received the help up to this point from these links:
Copy Entire Row to New Sheet:
https://www.extendoffice.com/documents/excel/3723-excel-move-row-to-another-sheet-based-on-cell-value.html
Create Sheets from Excel Cell Value:
Auto create Excel sheets from Array values
Remove Duplicates from Array:
https://wellsr.com/vba/2017/excel/vba-remove-duplicates-from-array/
So here is the code I have at the moment:
Functions:
move_Data_To_Sheet
Function move_Data_To_Sheet(myArray As Variant)
'Dim variables
Dim xRg As Range, xCell
Dim I As Long, J, K, Counter
Dim tmpltWkbk As Workbook
Dim ws1 As Worksheet
'Set variables
Set xRg = find_Header("fk_keyword")
Set tmpltWkbk = Workbooks("New DB.xlsm")
Set ws1 = tmpltWkbk.Sheets("TableSheet")
'Get the row count of the primary sheet
I = ws1.UsedRange.Rows.Count
Counter = 0
'loop through each element in my array
For Each c In myArray
'Check that that element is not empty
If c <> "" Then
'Add a new sheet after the active sheet
Sheets.Add After:=ActiveSheet
'Name the new sheet the same as the current element name in the array
ActiveSheet.Name = c
'Get the row count of the new sheet
J = Worksheets(c).UsedRange.Rows.Count
'Check if the value is 1
If J = 1 Then
'Check if the value is 0
If Application.WorksheetFunction.CountA(Worksheets(c).UsedRange) = 0 Then
'J is actually empty
J = 0
End If
End If
'Loop through the specific range (fk_keyword) on the primary sheet
For K = 1 To xRg.Count
'Check if the element matches the current element in the first array
If CStr(xRg(K).Value) = c Then
'Copy the entire row from the primary sheet to the newly added sheet
xRg(K).EntireRow.Copy Destination:=Worksheets(c).Range("A" & J + 1)
'Delete the row from the primary sheet
xRg(K).EntireRow.Delete
'Increment J
J = J + 1
'Increment the counter
Counter = Counter + 1
End If
'Next element in the array
Next
End If
'Next element in the array
Next c
End Function
Below is the issue I am experiencing.
When the data is copied to the new sheets based on the Cell value (KW ID), it seems to only copy some of the data and not all of it.
For Example, in the image below are the totals for the numeric values found under the fk_keyword column in my sheet. These numeric values are KW ID's and the totals are how many times they appear in the fk_keyword column.

Now when I copy the data to the new sheets, instead of having all the data copied, it will copy something like this:
- For KW ID 5: 11 Rows
- For KW ID 9: 15 Rows
- For KW ID 10: 13 Rows
And so on. But not a single KW ID, with all its rows were copied and I cannot understand why.
excel vba
excel vba
edited Mar 25 at 14:22
Eitel Dagnin
asked Mar 25 at 13:27
Eitel DagninEitel Dagnin
3675 silver badges17 bronze badges
3675 silver badges17 bronze badges
I believe you should have a look at this: stackoverflow.com/help/mcve
– user2261597
Mar 25 at 13:53
A note on the errors you identified: thearrColvariable is a collection. I don't believe a collection lets you check what values already exist in it (and some entries end up read-only, data type dependent). An informative link on collections: excelmacromastery.com/excel-vba-collections A link on Dictionaries (which have an.Existsmethod, but require either a reference or late-binding): excelmacromastery.com/vba-dictionary
– Mistella
Mar 25 at 13:58
@peakpeak Thank you for the reply. I do apologize for the long post, I just don't know how to shorten it.. If I leave out functions, then I will surely get asked to see the code. And on numerous posts I have been asked about removingOn Error Resume Nextso I just included it in the post.
– Eitel Dagnin
Mar 25 at 14:08
@Mistella Thank you for the reply, I will read up on the links provided and possibly look into changing the collection to a dictionary instead :)
– Eitel Dagnin
Mar 25 at 14:08
@peakpeak Okay, I have shortened it to only the function that does the copying now. :)
– Eitel Dagnin
Mar 25 at 14:23
|
show 1 more comment
I believe you should have a look at this: stackoverflow.com/help/mcve
– user2261597
Mar 25 at 13:53
A note on the errors you identified: thearrColvariable is a collection. I don't believe a collection lets you check what values already exist in it (and some entries end up read-only, data type dependent). An informative link on collections: excelmacromastery.com/excel-vba-collections A link on Dictionaries (which have an.Existsmethod, but require either a reference or late-binding): excelmacromastery.com/vba-dictionary
– Mistella
Mar 25 at 13:58
@peakpeak Thank you for the reply. I do apologize for the long post, I just don't know how to shorten it.. If I leave out functions, then I will surely get asked to see the code. And on numerous posts I have been asked about removingOn Error Resume Nextso I just included it in the post.
– Eitel Dagnin
Mar 25 at 14:08
@Mistella Thank you for the reply, I will read up on the links provided and possibly look into changing the collection to a dictionary instead :)
– Eitel Dagnin
Mar 25 at 14:08
@peakpeak Okay, I have shortened it to only the function that does the copying now. :)
– Eitel Dagnin
Mar 25 at 14:23
I believe you should have a look at this: stackoverflow.com/help/mcve
– user2261597
Mar 25 at 13:53
I believe you should have a look at this: stackoverflow.com/help/mcve
– user2261597
Mar 25 at 13:53
A note on the errors you identified: the
arrCol variable is a collection. I don't believe a collection lets you check what values already exist in it (and some entries end up read-only, data type dependent). An informative link on collections: excelmacromastery.com/excel-vba-collections A link on Dictionaries (which have an .Exists method, but require either a reference or late-binding): excelmacromastery.com/vba-dictionary– Mistella
Mar 25 at 13:58
A note on the errors you identified: the
arrCol variable is a collection. I don't believe a collection lets you check what values already exist in it (and some entries end up read-only, data type dependent). An informative link on collections: excelmacromastery.com/excel-vba-collections A link on Dictionaries (which have an .Exists method, but require either a reference or late-binding): excelmacromastery.com/vba-dictionary– Mistella
Mar 25 at 13:58
@peakpeak Thank you for the reply. I do apologize for the long post, I just don't know how to shorten it.. If I leave out functions, then I will surely get asked to see the code. And on numerous posts I have been asked about removing
On Error Resume Next so I just included it in the post.– Eitel Dagnin
Mar 25 at 14:08
@peakpeak Thank you for the reply. I do apologize for the long post, I just don't know how to shorten it.. If I leave out functions, then I will surely get asked to see the code. And on numerous posts I have been asked about removing
On Error Resume Next so I just included it in the post.– Eitel Dagnin
Mar 25 at 14:08
@Mistella Thank you for the reply, I will read up on the links provided and possibly look into changing the collection to a dictionary instead :)
– Eitel Dagnin
Mar 25 at 14:08
@Mistella Thank you for the reply, I will read up on the links provided and possibly look into changing the collection to a dictionary instead :)
– Eitel Dagnin
Mar 25 at 14:08
@peakpeak Okay, I have shortened it to only the function that does the copying now. :)
– Eitel Dagnin
Mar 25 at 14:23
@peakpeak Okay, I have shortened it to only the function that does the copying now. :)
– Eitel Dagnin
Mar 25 at 14:23
|
show 1 more comment
0
active
oldest
votes
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/3.0/"u003ecc by-sa 3.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%2f55338905%2fname-sheets-based-on-array-value-then-copy-rows-from-range-with-same-value-as-sh%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
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%2f55338905%2fname-sheets-based-on-array-value-then-copy-rows-from-range-with-same-value-as-sh%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
I believe you should have a look at this: stackoverflow.com/help/mcve
– user2261597
Mar 25 at 13:53
A note on the errors you identified: the
arrColvariable is a collection. I don't believe a collection lets you check what values already exist in it (and some entries end up read-only, data type dependent). An informative link on collections: excelmacromastery.com/excel-vba-collections A link on Dictionaries (which have an.Existsmethod, but require either a reference or late-binding): excelmacromastery.com/vba-dictionary– Mistella
Mar 25 at 13:58
@peakpeak Thank you for the reply. I do apologize for the long post, I just don't know how to shorten it.. If I leave out functions, then I will surely get asked to see the code. And on numerous posts I have been asked about removing
On Error Resume Nextso I just included it in the post.– Eitel Dagnin
Mar 25 at 14:08
@Mistella Thank you for the reply, I will read up on the links provided and possibly look into changing the collection to a dictionary instead :)
– Eitel Dagnin
Mar 25 at 14:08
@peakpeak Okay, I have shortened it to only the function that does the copying now. :)
– Eitel Dagnin
Mar 25 at 14:23