Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to copy row data from Sheet2 to Sheet1 based on Conditional Date

Developing using Excel 2007, but need to be compatible with 2003.

Problem:

Workbook has two sheets. Sheet two contains data, columns A thru M.
Column C is formatted for Date values. Not all rows contain a value in
column C. Data begins in row 2.

Sheet One has 3 'Option Buttons (form Control), labeled Contract date,
Effective Date, and End Date. When contract date is selected, Need
data on sheet two, column C (Date is contained here) to be queried
with a conditional filter... If date < today's date + 14 days ... If
true, copy column C thru M of that row to Sheet One beginning at cell
C13. Continue until all data rows have been tested.

If another 'Option Button' is selected, results from first query are
replaced by results from second query.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to copy row data from Sheet2 to Sheet1 based on Conditional Date

Here is the code that I have been working on... But I can not get it
to work..

Sub OptionButton1_Click()

TEMPLATE_SHEET = "Data_Input"
Database_sheet = "Carrier"
Application.ScreenUpdating = False

myzerorange = "C" & ActiveWindow.RangeSelection.Row & ":" & "M" &
ActiveWindow.RangeSelection.Row
mycompany = "C" & ActiveWindow.RangeSelection.Row
mydate = "D" & ActiveWindow.RangeSelection.Row
Database_sheet = ActiveSheet.Name
DATABASE_RECORDS = Sheets(Database_sheet).Range("C2:C1000")
Count_Row = 13

If Range(mycompany) < "" Then
If Range(mydate) < "" Then
'Range(mydate) = contractdate
If mydate < DateAdd("d", 14, "Today()") Then
Range(myzerorange).Copy
Sheets(TEMPLATE_SHEET).Select

'To identify the next blank row in the database sheet

DATABASE_RECORDS =
Sheets(TEMPLATE_SHEET).Range("C13:C1000")
'To identify the next blank row in the data_Input
sheet
For Each DBRECORD In DATABASE_RECORDS
If DBRECORD < "" Then Count_Row = Count_Row + 1
Next DBRECORD

Sheets(TEMPLATE_SHEET).Range("C" & Count_Row).Select
ActiveSheet.Paste

'Return to origin and check for another contract date
Sheets(Database_sheet).Select
Else

End If
Else

End If
End If
Application.ScreenUpdating = True

End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default How to copy row data from Sheet2 to Sheet1 based on Conditional Date

On Jun 21, 12:09*pm, John Lauer wrote:
Developing using Excel 2007, but need to be compatible with 2003.

Problem:

Workbook has two sheets. Sheet two contains data, columns A thru M.
Column C is formatted for Date values. Not all rows contain a value in
column C. Data begins in row 2.

Sheet One has 3 'Option Buttons (form Control), labeled Contract date,
Effective Date, and End Date. When contract date is selected, Need
data on sheet two, column C (Date is contained here) to be queried
with a conditional filter... If date < today's date + 14 days ... If
true, copy column C thru M of that row to Sheet One beginning at cell
C13. Continue until all data rows have been tested.

If another 'Option Button' is selected, results from first query are
replaced by results from second query.

"If desired, send your file to dguillett1 @gmail.com I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."
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
copy data from sheet2 to sheet1 when sheet2 has variable # of rows Anne Excel Discussion (Misc queries) 6 February 27th 09 10:48 PM
Automatic populate Sheet2 with data from Sheet1 based on criteria. Saurabh Khanna. Excel Discussion (Misc queries) 2 December 30th 08 02:19 PM
fetch the data from sheet2 & place it in sheet1 based on the locat Ren Excel Programming 5 January 12th 08 08:45 AM
Function on Sheet1 based on data on Sheet2 Sony Excel Worksheet Functions 0 February 7th 07 05:44 PM
copy data from sheet1 based on criteria in sheet2 to sheet3 Fred Excel Programming 3 May 25th 04 01:46 PM


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