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

I would like to know how to take data in cell A1 of Workbook1.Sheet1 and
place it in cell A1 of Workbook2.Sheet2 via a macro from workbook1?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Updating another workbook

On 5 mei, 14:24, WLMPilot wrote:
I would like to know how to take data in cell A1 of Workbook1.Sheet1 and
place it in cell A1 of Workbook2.Sheet2 via a macro from workbook1?

Thanks.


Hi,

Your question is very short.
Based on this information I can only give this example:

Sub Copy1Cell()
Workbooks("Workbook2").Worksheets("Sheet2").Range( "A1").Value = _
Workbooks("Workbook1").Worksheets("Sheet1").Range( "A1").Value
End Sub

HTH,

Wouter
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Updating another workbook

Sub Answer()
Workbooks("Workbook2.xls").Sheets("Sheet2").Range( "A1").Value =
Thisworkbook.Sheets("Sheet1").Range("A1").Value
End Sub

"WLMPilot" wrote:

I would like to know how to take data in cell A1 of Workbook1.Sheet1 and
place it in cell A1 of Workbook2.Sheet2 via a macro from workbook1?

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 470
Default Updating another workbook

Thanks. I have one more question pertaining to this. The master workbook
(workbook1) will be used by the boss while all other workbooks will have the
an employee's name as the filename.

I want the boss to be able to add to the master list any criteria
(questions) he would like to add to the list already in place. I will have
an adjacent cell to the criteria (for QA purposes) that will indicate the
date the criteria was added.

I am guessing I need to use the xlUP to locate the first empty row at the
bottom of the list in each employee workbook. So, given the following data,
what would the code be:

WORKBOOK1 (Master).Sheet1
NOTE: Boss adds a new criteria to QA list in B30 with date added in A30.
Need to
update all workbooks for each employee.
A30 = 05/05/10 (date format)
B30 = Are all signatures obtained? (text format)
D1:D? = Each employees name (Unknown how many rows needed for employees)

WORKBOOK2-?? (Each named for an employee listed in workbook1
SHEET1
A1-A? = list of criteria based on master list

Thanks,
Les

"Bob Umlas, Excel MVP" wrote:

Sub Answer()
Workbooks("Workbook2.xls").Sheets("Sheet2").Range( "A1").Value =
Thisworkbook.Sheets("Sheet1").Range("A1").Value
End Sub

"WLMPilot" wrote:

I would like to know how to take data in cell A1 of Workbook1.Sheet1 and
place it in cell A1 of Workbook2.Sheet2 via a macro from workbook1?

Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Updating another workbook

Hi there,

I have some remarks to start with

For starters may I suggest you put the names of the employees on
sheet2.
You should keep in mind that an employee may have his/her personal
workbook in use when the boss tries to update it.
So copy all questions every time the update proces is running.

It might be something like:

' --------- Start of code
Sub UpdateEmployeeSheets()

Dim strFolder As String

Dim strFile As String

Dim lngRow As Long

Dim intPos As Integer

Dim wbkEmployee As Workbook

Dim strSource As String

' Find the path to the folder

strFolder = ThisWorkbook.FullNameURLEncoded

intPos = InStrRev(strFolder, "\")

strFolder = Left(strFolder, intPos)

lngRow = 2

Do

ThisWorkbook.Sheets("Sheet1").UsedRange.Copy

strFile = strFolder &
ThisWorkbook.Worksheets("Sheet2").Cells(lngRow, 1).Value

On Local Error Resume Next

Set wbkEmployee = Application.Workbooks.Open(strFile, False,
False)

If Err.Number 0 Then

ThisWorkbook.Worksheets("Sheet2").Cells(lngRow, 2).Value =
"In use"

Else

wbkEmployee.Sheets("Sheet1").Select

wbkEmployee.Sheets("Sheet1").Range("A1").Select

wbkEmployee.Sheets("Sheet1").Paste

ThisWorkbook.Worksheets("Sheet2").Cells(lngRow, 2).Value =
"Updated"

wbkEmployee.Close True

End If

lngRow = lngRow + 1

Loop Until IsEmpty(ThisWorkbook.Worksheets("Sheet2").Cells(ln gRow,
1))

Application.CutCopyMode = False

End Sub

'---- End of listing

If you copy this and get some red lines in you code just concatenate
those to a single line.

HTH,

Wouer
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
Automatically updating a workbook from a different workbook day by not an excel guru Excel Discussion (Misc queries) 4 September 20th 06 03:35 AM
My workbook links are not updating (its 30,000 KB size workbook). rselena Excel Discussion (Misc queries) 1 August 14th 06 09:14 PM
Auto updating a workbook with data from another workbook Richard Excel Discussion (Misc queries) 0 November 6th 05 03:50 PM
updating a workbook Robert Couchman[_4_] Excel Programming 3 February 17th 04 12:57 PM
Transparently updating another workbook from the current workbook lothario[_40_] Excel Programming 3 November 2nd 03 01:58 AM


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

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"