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

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,213,533
Messages
6,114,179
Members
448,554
Latest member
Gleisner2

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