Hello,
I am trying to work my way through a script that will take information from one column, concatenate it with another, repeat that for a section of cells, and then repeat all those steps with a different original field, incrementing until a blank field is reached. The data I have looks like so, the last group show in the middle of being processed:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Plate Number[/TD]
[TD]Well (H)[/TD]
[TD]Sample ID[/TD]
[/TR]
[TR]
[TD]500[/TD]
[TD]A1[/TD]
[TD]500A1[/TD]
[/TR]
[TR]
[TD]501[/TD]
[TD]A2[/TD]
[TD]500A2[/TD]
[/TR]
[TR]
[TD]502[/TD]
[TD]A3[/TD]
[TD]500A3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A1[/TD]
[TD]501A1
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A2[/TD]
[TD]501A2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A3[/TD]
[TD]501A3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A1
[/TD]
[TD]502A1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I recorded a macro to do the calculations, and copy the well (H) column values below the first set, to prepare for the next round of sample ID creation.
I am having trouble getting a variable assigned to the plate number to increment after finishing a round of calculations and problems with making each round of sample ID's begin below the previous round.
Here is what I am working with, but am unsure if I am even on the right track. Any help would be appreciated!
I am trying to work my way through a script that will take information from one column, concatenate it with another, repeat that for a section of cells, and then repeat all those steps with a different original field, incrementing until a blank field is reached. The data I have looks like so, the last group show in the middle of being processed:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Plate Number[/TD]
[TD]Well (H)[/TD]
[TD]Sample ID[/TD]
[/TR]
[TR]
[TD]500[/TD]
[TD]A1[/TD]
[TD]500A1[/TD]
[/TR]
[TR]
[TD]501[/TD]
[TD]A2[/TD]
[TD]500A2[/TD]
[/TR]
[TR]
[TD]502[/TD]
[TD]A3[/TD]
[TD]500A3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A1[/TD]
[TD]501A1
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A2[/TD]
[TD]501A2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A3[/TD]
[TD]501A3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A1
[/TD]
[TD]502A1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I recorded a macro to do the calculations, and copy the well (H) column values below the first set, to prepare for the next round of sample ID creation.
I am having trouble getting a variable assigned to the plate number to increment after finishing a round of calculations and problems with making each round of sample ID's begin below the previous round.
Here is what I am working with, but am unsure if I am even on the right track. Any help would be appreciated!
Code:
Sub All_DataSets() Dim p As Long, r As Long
p = ActiveSheet.Cells(Rows.Count, 4).End(xlUp).Row
Range("A1").Select
For r = 1 To p
Macro1
Next
r = r + 1
End Sub
Sub Macro1()
Range("E2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=R2C3&RC[-1]"
ActiveCell.Select
Selection.AutoFill Destination:=ActiveCell.Range("A1:A92"), Type:= _
xlFillDefault
ActiveCell.Range("A1:A92").Select
ActiveCell.Offset(0, -1).Range("A1:A92").Select
ActiveCell.Offset(91, 0).Range("A1").Activate
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(92, 0).Range("A1").Select
End Sub