Hi All,
I've written a macro that is supposed to do the following once it is execute:
1) Requests the user to click on a cell (to get its row value)
2) Use the row value to get a range of values over 3 cells in steps of 5 across the column (essentially I'm taking data values across a table whose type repeats itself every 5 columns)
3) Pasting the values in a table in a different sheet but down a row instead of across a column
The code compiles and executes but I get no values in the target table. There isn't even an error. So I'm wondering, how does one go about debugging the thing?
Sub GenerateReport()
Dim NewMonth As String
Dim Point As Range
Dim Supplier As String
Dim TrendRng As Range
Dim RptVal As Variant
Dim i As Integer
Dim x As Integer
Set Point = Application.InputBox(prompt:="Select Supplier", Type:=8) 'Selects the supplier to copy
'Historical NCD,PCR,Delivery data to Report
Sheets("Trend").Activate
For i = 2 To 55 Step 5
'Copies a range of values every 5 steps across the column
Set TrendRng = ActiveSheet.Range(Cells(Point.row, i), Cells(Point.row, i + 2))
RptVal = TrendRng.Value
'/Copies a range of values every 5 steps across the column
'Paste values down a row
Sheets("Report").Activate
For x = 17 To 28 Step 1
ActiveSheet.Range(Cells(i, 3), Cells(i, 5)).Value = RptVal
Next x
Next i
'/Paste values down a row
End Sub
Bookmarks