VBA Macro - References Another Worksheet and repeats data based on a number in another referenced cell.

BAQI

New Member
Joined
Dec 2, 2022
Messages
40
Office Version
  1. 2016
Platform
  1. Windows
This is what I'm trying to accomplish:

On Worksheet "T Label" it looks at columns A2:A100 and also H2:H100. There might be no data between a series of information.
On Worksheet "Database" it puts the information in C2:C

The macro will look for information in Column A on "T Label", and if there is information in Column A (from A2:A), it looks at the corresponding H cell, which will have a number.
From there it'll put the information in C2:C on worksheet "Database", multiplied by the number in Column H on "T Label"

Example:

Worksheet "T Label" has:

A2 - 1234 H2 - 6
A3 - empty
A4 - 9876 H4 - 3

Worksheet "Database" will have the following in Column C:

C2 - 1234
C3 - 1234
C4 - 1234
C5 - 1234
C6 - 1234
C7 - 1234
C8 -
C9 - 9876
C10 - 9876
C11 - 9876
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,215,111
Messages
6,123,155
Members
449,098
Latest member
Doanvanhieu

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