Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copying data to another workbook

I would like a user to enter data to a workbook without directly accessing
that workbook.

In another workbook I have created in cells a1:f1 I have a formulas that
result in a cell references (these are variable), but for example say A1 =
$BT$150, $BU$150 etc.

I would like the value from cells a2 through f2 to go to Target workbook
$BT$150, $BU$150 etc

Thank you

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Copying data to another workbook

Hi

Assuming that target cells will always be next to each other, this should do
it:

Sub CopyToOtherWB()
Dim TargetWb As Workbook
Dim TargetSh As Worksheet
Dim CopyFrom As Range
Dim DestCell As String
Dim InputSh As Worksheet

Set TargetWb = Workbooks("Book2.xls") ' Change to suit
Set TargetSh = TargetWb.Worksheets("Sheet1")
Set InputSh = ThisWorkbook.Sheets("Sheet1") ' Change to suit
Set CopyFrom = InputSh.Range("A2:F2")

DestCell = InputSh.Range("A1").Value
CopyFrom.Copy Destination:=TargetSh.Range(DestCell)

End Sub

Best regards,
Per

"Steve" skrev i meddelelsen
...
I would like a user to enter data to a workbook without directly accessing
that workbook.

In another workbook I have created in cells a1:f1 I have a formulas that
result in a cell references (these are variable), but for example say A1 =
$BT$150, $BU$150 etc.

I would like the value from cells a2 through f2 to go to Target workbook
$BT$150, $BU$150 etc

Thank you


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying data from one workbook to another Amber T New Users to Excel 1 June 19th 08 06:53 PM
Copying Data from one workbook to another madduck Excel Programming 3 April 3rd 07 02:08 AM
Copying data from workbook/sheets to another workbook/sheet yukon_phil Excel Programming 0 July 26th 06 07:33 PM
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook burl_rfc Excel Programming 1 April 1st 06 08:48 PM
copying data from one workbook to another seawren Excel Discussion (Misc queries) 2 February 16th 05 11:55 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"