Hi.
I'm new to doing macros in Excel, but after a lot of struggle I've managed to at least make a start.
So, I will be having a sheet of data, where each column represents the results of one experiment.
The data will occupy rows 2 to 72 in all columns.
For each experiment/column, I will need to process those data so I can then better represent them on my graphs.
So the macro I managed to make does the job for a single column. First, it adds next to it a couple of extra columns where the processed data will go. Then, the formulas work out the data. This was done for the first column (which is always B) and it does the job, but I will need to do it also for each of the other columns.
My macro is this (I managed to simplify the macro as much as possible):
My first question is whether there are any ways to simplify it even better.
My second and most important question is: This is only for column B, so how do I make the macro so that it contunues doing the same procedure for each of the rest of the columns?
Hope you get me, but ask me if you didn't.
I'm new to doing macros in Excel, but after a lot of struggle I've managed to at least make a start.
So, I will be having a sheet of data, where each column represents the results of one experiment.
The data will occupy rows 2 to 72 in all columns.
For each experiment/column, I will need to process those data so I can then better represent them on my graphs.
So the macro I managed to make does the job for a single column. First, it adds next to it a couple of extra columns where the processed data will go. Then, the formulas work out the data. This was done for the first column (which is always B) and it does the job, but I will need to do it also for each of the other columns.
My macro is this (I managed to simplify the macro as much as possible):
VBA Code:
Sub Normalise_RD2()
'
' Normalise_RD2 Macro
'
'
Columns("C:C").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("C:C").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A73").FormulaR1C1 = "Max"
Range("A74").FormulaR1C1 = "Min"
Range("B74").Value = "=MIN(B2:B72)"
Range("C2").FormulaR1C1 = "=RC[-1]-R74C[-1]"
Range("C2").AutoFill Destination:=Range("C2:C72"), Type:=xlFillDefault
Range("C73").Value = "=MAX(B2:B72)"
Range("D2").FormulaR1C1 = "=RC[-1]/R73C[-1]"
Range("D2").AutoFill Destination:=Range("D2:D72"), Type:=xlFillDefault
Columns("D:D").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
End With
End Sub
My first question is whether there are any ways to simplify it even better.
My second and most important question is: This is only for column B, so how do I make the macro so that it contunues doing the same procedure for each of the rest of the columns?
Hope you get me, but ask me if you didn't.