Getting to the next line

schwann

New Member
Joined
Nov 4, 2010
Messages
5
Hi all,

I have been writting a form that uses rather simple math. The imput numbers on this form tab will change depending on what I'm working on. I've set up a macro to transfer the data on this form to another data tab within the same document. I'm having problems with getting the information to move down on the data tab when the macro button is pushed on the form tab. Any help would be great!!!
 
Last edited:

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I already looked at that and found it useful for creating the macro. I just can't get the data to add to a table like I would like.
 
Upvote 0
Sub Addtolist()
'
' Addtolist Macro
'
'
Sheets("Sheet1").Select
Range("K5").Select
ActiveCell.FormulaR1C1 = "=Sheet2!R23C10"
Range("J5").Select
ActiveCell.FormulaR1C1 = "=Sheet2!R22C10"
Range("I5").Select
ActiveCell.FormulaR1C1 = "=Sheet2!R21C10"
Range("H5").Select
ActiveCell.FormulaR1C1 = "=Sheet2!R20C10"
Range("G5").Select
ActiveCell.FormulaR1C1 = "=Sheet2!R5C10-Sheet2!R9C11"
Range("F5").Select
ActiveCell.FormulaR1C1 = "=Sheet2!R11C10"
Range("D5:E5").Select
ActiveCell.FormulaR1C1 = "=Sheet2!R6C5"
Range("B5:C5").Select
ActiveCell.FormulaR1C1 = "=Sheet2!R6C2"
Range("B7:C7").Select
Sheets("Sheet2").Select
Range("B6:C6").Select
End Sub
 
Upvote 0
Try like this (LR only needs to be calculated once)


Code:
Sheets("Sheet1").Select
LR = Range("K" & Rows.Count).End(xlUp).Row + 1
Range("K" & LR).FormulaR1C1 = "=Sheet2!R23C10"
 
Upvote 0
Like this

Code:
Sub Addtolist()
'
' Addtolist Macro
'
'
Sheets("Sheet1").Select
LR = Range("K" & Rows.Count).End(xlUp).Row + 1
Range("K" & LR).FormulaR1C1 = "=Sheet2!R23C10"
Range("J" & LR).FormulaR1C1 = "=Sheet2!R22C10"
'and so on
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,643
Members
452,663
Latest member
MEMEH

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