Normalise Data

PHOTO EMBED

Wed Sep 08 2021 05:19:36 GMT+0000 (UTC)

Saved by @Darkleech #vba

Sub NormalizeData() ' Not very good, perhaps look to replace
Dim Rng As Range
Dim ws As Worksheet
 
On Error Resume Next
Set Rng = Application.InputBox(Prompt:="Select a range to normalize data" _
, Title:="Select a range", Default:=ActiveCell.Address, Type:=8)
On Error GoTo 0
 
If Rng Is Nothing Then
Else
    Application.ScreenUpdating = False
    Set ws = Sheets.Add
    i = 0
    For r = 1 To Rng.Rows.Count - 1
        For c = 1 To Rng.Columns.Count - 1
            ws.Range("A1").Offset(i, 0) = Rng.Offset(0, c).Value
            ws.Range("A1").Offset(i, 1) = Rng.Offset(r, 0).Value
            ws.Range("A1").Offset(i, 2) = Rng.Offset(r, c).Value
            i = i + 1
        Next c
    Next r
    ws.Range("A:C").EntireColumn.AutoFit
    Application.ScreenUpdating = True
End If
End Sub
content_copyCOPY

Not very good, perhaps look to replace