VBA Search Loop If Empty Copy Paste Next Help!!

ipon70

Board Regular
Joined
May 8, 2013
Messages
86
Office Version
  1. 2016
Platform
  1. Windows
I am in VBA H**L right now.
Here is what I need the Search Loop to do.

In Column A cell "A2" is a changing value depending on the person selected. This is basically a RecordId column.
Starring In Column H cell "H2:JZ2" are changing values. These values could be nothing (empty), or contain data.

Here is what I need it to do.
I need it to hunt across the 2nd row again starting at "H2" for the first cell with data, if it finds it, copy that value, and then move down the amount of rows indicated in "A2". Paste it into whatever cell is at that location.
Then move onto the next cell and hunt for the next value, and repeat.

EXAMPLE: "A2" cell has a value of 954 in it indicating the row of that persons information, again basically a RecordId column. It starts looking at "H2" and finds information at cell "J2" copies that information, moves down to cell "J954" and pastes it there. Then starts over at "K2" and looks for data, then "L2" and looks for data, so on and so forth until it reaches "JZ2" and then stops.

This will be triggered manually by a person pushing an button to "save or update" the record.

Thank you so so much in advance, and if you have questions please ask.

I hope that all makes sense.
 
That is a totally different question, so needs a new thread.
Got it, I will post in just a little and would love you to tackle it, as I know you are amazing with short, concise, and clean code. Thanks again.
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,224,819
Messages
6,181,153
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