LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #14   Report Post  
Member
 
Posts: 70
Default

Quote:
Originally Posted by KeriM View Post
John,

Perfect! It does the calculation and writes it on the source worksheet.

Now, how can I get it write to another workbook? This one may be a bit tricker, because the workbook I want to write to doesn't always have the same name (it is always open though). This is how it is written (and working) for my other sheets:

Code:
Dim ws As Workbook
If ws.Name Like "*Count*" Then
Windows(ws.Name).Select
    Range("C3").Select
    ActiveCell.FormulaR1C1 = 'write answer here'
When I tried to implement this code into yours, it was posting a value of 0, probably because it lost the values when I switched sheets. Can I store the answer in a variable and then call the variable to write the answer in the cell?
Update: tried it again, it works!

Code:
For i = 1 To 700
If InStr(Cells(i, 2), "a") And InStr(Cells(i, 3), "1") Then
num = Cells(i, 5) - Cells(i, 6)
For Each ws In Workbooks
If ws.Name Like "*Count*" Then Windows(ws.Name).Activate
Next
Range("C3").Select
ActiveCell.FormulaR1C1 = num
End If
Next i
Thanks so much for your help John!
 
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
"Coult not find specified object" and "Path-File access error" messages Robert Crandal Excel Programming 3 December 19th 09 09:12 PM
Whats wrong with this? MyWBAccRep.Sheets("Volumes").Cells.Find("latest").Copy.Offset(0, Simon[_2_] Excel Programming 2 August 11th 08 01:29 PM
find "Cancellation" in column "A" and copy all data from Columns B-F onto another Sheet bjohnson Excel Programming 1 September 20th 07 04:02 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM


All times are GMT +1. The time now is 04:59 PM.

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

About Us

"It's about Microsoft Excel"