0

I am trying to record a macro that copies values from 4 cells then pastes them on another sheet that serves as a sort of log. I cannot get the values to paste in a new row though despite using the "Relative References" button when recording the macro. Is there something I can add to the code below to make the values paste in the next available row?

'''
Sub Again()
'
' Again Macro
'

'
    Range("B5").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Results").Select
    ActiveCell.Offset(0, -3).Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Sheets("Test").Select
    Range("C5").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Results").Select
    ActiveCell.Offset(0, 1).Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Sheets("Test").Select
    Range("D5").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Results").Select
    ActiveCell.Offset(0, 1).Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Sheets("Test").Select
    Range("E5").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Results").Select
    ActiveCell.Offset(0, 1).Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
End Sub
'''
J Chase
  • 107
  • 6

1 Answers1

0
Sub add_value()

Dim wbA As Workbook
Dim wsA As Worksheet

Set wbA = ActiveWorkbook
Set wsA = wbA.Worksheets("Sheet1")

Dim nrow As Long

nrow = 6

    Do Until wsA.Range("B" & nrow).Value = ""
        wsA.Range("B" & nrow).Value = wsA.Range("B3").Value
        wsA.Range("C" & nrow).Value = wsA.Range("C3").Value
            Exit Sub
        nrow = nrow + 1
    Loop

End Sub

This is actually working, now i just have to figure out how to offset it

J Chase
  • 107
  • 6