ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Advance "paste to" cell by row to create a list (https://www.excelbanter.com/excel-programming/364870-advance-paste-cell-row-create-list.html)

Ryan

Advance "paste to" cell by row to create a list
 
Hi, I am trying to write a code in VB that will copy and paste a formula's
result into a list based on the variable entered. How do you paste the
results to an output that would advance the cell incrementally by row? (I
cannot simply drag down the formula, the output value must be pasted)

End objective: Input variable list has corresponding Output Formula Value
list
Please see current code below:
Thanks in advance,
Ryan

My code so far:
Col A-list of integer variables, B1-input integer, B3-formula (based off
B1), Col C - output in a list form; Please note: Cannot program output Col C
as formula

Sub A()
'
For Each DATA In Worksheets("Sheet1").Range("A1:A25").Cells
DATA.Select
Selection.Copy
Range("B1").Select
ActiveSheet.Paste
Range("B3").Select
Application.CutCopyMode = False
Selection.Copy
Range("C1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Next
' this code will paste the formulas result in C1 over the previous variables
result
'
End Sub


All times are GMT +1. The time now is 07:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com