Use VBA to find which row on another worksheet contains a given value

Phil Smith

Active Member
Joined
Aug 13, 2004
Messages
285
Office Version
  1. 365
Platform
  1. Mobile
Hello Excel People!

In column A on one worksheet, "Base Roster", I have a column of numbers, in order from 1 to 70.

In Column A on another worksheet, "My Roster", I also have a column of numbers, but they are not in ascending order.

As my code loops through and fills in worksheet "Base Roster" with all the details from the basic and unformatted roster from work, once it has filled in a week, I would like to copy that week, for example the range being "Week1" to the corresponding row in "My Roster", but I dont know how to find the row in "My Roster" using VBA.

For this example, A1 on "Base Roster" contains 1. The formatted 70 line roster is over 560 rows with each day taking 8 rows.

On "My Roster", line 1 doesn't apppear until A225, but it is getting that magic number, 225, that I am stumped on.

So you wonderful VBA wizards, over to you fine people!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top