ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create formula using VBA (https://www.excelbanter.com/excel-programming/408925-create-formula-using-vba.html)

medirate

Create formula using VBA
 
In worksheet One, starting with A3, I have 10 columns and 10 rows full of
number data. Using VBA, I would like to go to worksheet Two, column A, Row
3, and enter the following: Concatenate (One!A3," ",One!A4," ",One!A5) and
copy this formula (relatively) from A3 through A12.



Can someone tell me how this is done or point me in the right direction?



Thanks!



Jon Peltier

Create formula using VBA
 
Worksheets("Two").Range("A3:A12").Formula = _
"=One!A3&"" ""&One!A4&"" ""&One!A5"

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"medirate" wrote in message
...
In worksheet One, starting with A3, I have 10 columns and 10 rows full of
number data. Using VBA, I would like to go to worksheet Two, column A, Row
3, and enter the following: Concatenate (One!A3," ",One!A4," ",One!A5) and
copy this formula (relatively) from A3 through A12.



Can someone tell me how this is done or point me in the right direction?



Thanks!





Mike H

Create formula using VBA
 
Maybe

Sub sonic()
Sheets("Sheet2").Range("A3").Formula = _
"=Sheet1!A3 &"" ""& Sheet1!A4 & "" ""&Sheet1!A5"
Sheets("Sheet2").Range("A3").AutoFill Destination:=Range("A3:A12")
End Sub

Mike

"medirate" wrote:

In worksheet One, starting with A3, I have 10 columns and 10 rows full of
number data. Using VBA, I would like to go to worksheet Two, column A, Row
3, and enter the following: Concatenate (One!A3," ",One!A4," ",One!A5) and
copy this formula (relatively) from A3 through A12.



Can someone tell me how this is done or point me in the right direction?



Thanks!





All times are GMT +1. The time now is 11:17 PM.

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