PC Review


Reply
Thread Tools Rate Thread

Copying data to another workbook

 
 
Steve
Guest
Posts: n/a
 
      20th Feb 2009
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 With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      20th Feb 2009
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" <(E-Mail Removed)> skrev i meddelelsen
news:%(E-Mail Removed)...
>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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying Data from a workbook to another workbook Pam Microsoft Excel Programming 1 10th Mar 2010 08:51 PM
Copying Data from one workbook to another =?Utf-8?B?bWFkZHVjaw==?= Microsoft Excel Programming 3 3rd Apr 2007 02:08 AM
Copying data from workbook/sheets to another workbook/sheet =?Utf-8?B?eXVrb25fcGhpbA==?= Microsoft Excel Programming 0 26th Jul 2006 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 Microsoft Excel Programming 1 1st Apr 2006 08:48 PM
copying data from one workbook to another =?Utf-8?B?c2Vhd3Jlbg==?= Microsoft Excel Misc 2 16th Feb 2005 11:55 PM


Features
 

Advertising
 

Newsgroups
 


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