Macro to copy data to another worksheet?

Yiaah22

New Member
Joined
Apr 11, 2022
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
I'm trying to make (multiple) buttons that copy adjacent info to a list on another sheet, do some simple maths, and then increment the row (starting from row 17, if it's blank). At the moment I'm stuck like this:

VBA Code:
Sub Part1()

Dim Row As Integer
Row = 17

If Worksheets("Worksheet1").Cells(Row, 3) < 0 Then
    Sheets("Worksheet1").Select
    Range("B" & Row).Select
    ActiveCell.FormulaR1C1 = "='Worksheet2'!R4C9"
    Range("C" & Row).Select
    ActiveCell.FormulaR1C1 = "='Worksheet2'!R4C2"
    Range("D" & Row).Select
    ActiveCell.FormulaR1C1 = "=('Worksheet2'!R4C6)*B" & Row
    Range("E" & Row).Select
    ActiveCell.FormulaR1C1 = "=('Worksheet2'!R4C7)*B" & Row

Else
Row = Row + 1


End Sub

It's not working at all sadly. I have no idea where to go from here
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
It would be easier to help if you could use the XL2BB add-in (icon in the menu) to attach screenshots (not pictures) of your two sheets. Alternately, you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary).
 
Upvote 0

Forum statistics

Threads
1,214,422
Messages
6,119,396
Members
448,891
Latest member
tpierce

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top