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:
<tbody>
</tbody>
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:
Plate Number | Well (H) | Sample ID |
500 | A1 | 500A1 |
501 | A2 | 500A2 |
502 | A3 | 500A3 |
A1 | 501A1 | |
A2 | 501A2 | |
A3 | 501A3 | |
A1 | 502A1 | |
A2 | ||
A3 | ||
<tbody>
</tbody>
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