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

Is this possible?

Active Workbook = the open workbook (variable document name)
Active Worksheet = Data Entry
Surveyed Buildings = a worksheet within a closed workbook (2009 Surveys) a
different folder

Activeworksheet("A2") = building #
Activeworksheet("B2") = survey date
Activeworksheet("C2") = next scheduled survey cycle (1 year, 2 year, 3 year)

Surveyed Buildings("R:R") = building #
Surveyed Buildings("S:S") = survey date
Surveyed Buildings("T:T") = next scheduled survey cycle
Surveyed Buildings("U:U") = next scheduled survey

If Activeworksheet ("A2") matches a building number in Surveyed Buildings
("R:R"), place values from Activeworksheet(B2, C2) in corresponding cells of
Surveyed Buildings: otherwise place the data on a new row

Calculate the Surveyed Buildings next survey date: survey date(S:S) + 1
year, 2 year, or 3 year

Also! If the next scheduled survey date is calculated on the
Activeworksheet, can the data be sent to Outlook (on the calendar or a new
task?)


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

I don't quite understand how you want to handle the future survey cycles,
but I assumed that columns S, T and U were where you wanted them. If not,
you can play around with this and re-post for more help.

Sub survey()
Dim sh As Worksheet, lr As Long, c As Range
Set sh = ActiveSheet
lr = sh.Cells(Rows.Count, 18).End(xlUp).Row
Set rng = sh.Range("R2:R" & lr)
For Each c In rng
If c.Value = Range("A2").Value Then
c.Offset(0, 1) = Range("B2").Value + 365
c.Offset(0, 2) = Range("B2").Value + 730
c.Offset(0, 3) = Range("B2").Value + 1095
Else
Range("R" & lr + 1) = Range("A2").Value
Range("R" & lr + 1).Offset(0, 1) = _
Range("B2").Value + 365
Range("R" & lr + 1).Offset(0, 2) = _
Range("B2").Value + 730
Range("R" & lr + 1).Offset(0, 3) = _
Range("B2").Value + 1095
End If
Next
End Sub





"Suzanne" wrote in message
...
Is this possible?

Active Workbook = the open workbook (variable document name)
Active Worksheet = Data Entry
Surveyed Buildings = a worksheet within a closed workbook (2009 Surveys) a
different folder

Activeworksheet("A2") = building #
Activeworksheet("B2") = survey date
Activeworksheet("C2") = next scheduled survey cycle (1 year, 2 year, 3
year)

Surveyed Buildings("R:R") = building #
Surveyed Buildings("S:S") = survey date
Surveyed Buildings("T:T") = next scheduled survey cycle
Surveyed Buildings("U:U") = next scheduled survey

If Activeworksheet ("A2") matches a building number in Surveyed Buildings
("R:R"), place values from Activeworksheet(B2, C2) in corresponding cells
of
Surveyed Buildings: otherwise place the data on a new row

Calculate the Surveyed Buildings next survey date: survey date(S:S) + 1
year, 2 year, or 3 year

Also! If the next scheduled survey date is calculated on the
Activeworksheet, can the data be sent to Outlook (on the calendar or a new
task?)




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
Send data to a specific worksheet in a closed Workbook INTP56 Excel Programming 0 July 23rd 07 09:38 PM
VB Code to Send Workbook to a FTP [email protected] Excel Programming 1 August 21st 06 01:26 PM
Send sheet rather than workbook. harpscardiff[_25_] Excel Programming 1 May 11th 06 10:55 AM
Send sheet rather than workbook. Norman Jones Excel Programming 0 May 10th 06 11:40 AM
Send worksheets in workbook billy2willy Excel Discussion (Misc queries) 4 July 12th 05 07:29 AM


All times are GMT +1. The time now is 03:32 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"