Hello,
I am a VBA beginner and looking to write a code to insert x number of roles based on every time the value of a cell in Sheet1 Column B is not "100" or blank, and count of an ID number in Sheet2 column A (minus 1). Further explanation below.
Example Data
Sheet1
[TABLE="width: 500"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]ID #
[/TD]
[TD]Percentage
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1100
[/TD]
[TD]50
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1200
[/TD]
[TD]100
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1300
[/TD]
[TD]-
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1400
[/TD]
[TD]-
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1500
[/TD]
[TD]100
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1600
[/TD]
[TD]75
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1700
[/TD]
[TD]75
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1800
[/TD]
[TD]100
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2
[TABLE="width: 500"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[TD]Column C
[/TD]
[TD]Column D
[/TD]
[/TR]
[TR]
[TD]ID #
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1100
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1100
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1100
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1200
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1500
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1700
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1700
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1700
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Example:
Macro finds that Sheet1 ID# 1100 is "50" in column b (which is not 100 or blank) and then inserts 2 rows (3 minus 1) under 1100 in Sheet1 because Sheet2 has three occurrences of "1100" in column A
I am a VBA beginner and looking to write a code to insert x number of roles based on every time the value of a cell in Sheet1 Column B is not "100" or blank, and count of an ID number in Sheet2 column A (minus 1). Further explanation below.
Example Data
Sheet1
[TABLE="width: 500"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]ID #
[/TD]
[TD]Percentage
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1100
[/TD]
[TD]50
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1200
[/TD]
[TD]100
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1300
[/TD]
[TD]-
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1400
[/TD]
[TD]-
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1500
[/TD]
[TD]100
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1600
[/TD]
[TD]75
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1700
[/TD]
[TD]75
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1800
[/TD]
[TD]100
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2
[TABLE="width: 500"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[TD]Column C
[/TD]
[TD]Column D
[/TD]
[/TR]
[TR]
[TD]ID #
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1100
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1100
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1100
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1200
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1500
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1700
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1700
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1700
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Example:
Macro finds that Sheet1 ID# 1100 is "50" in column b (which is not 100 or blank) and then inserts 2 rows (3 minus 1) under 1100 in Sheet1 because Sheet2 has three occurrences of "1100" in column A