PC Review


Reply
Thread Tools Rate Thread

Date Match Input Macro

 
 
=?Utf-8?B?TW9oYW1lZA==?=
Guest
Posts: n/a
 
      19th Jan 2004
Hi,

I have been working on this thing for the past couple of days not. Finally got somwhere with some help. Thanks. However, I am still not fully there. My problem lies as follows.

Sheet1
A B C

Row1 Date Cured Follow Up
Row2 1/2 2 1
Row3 1/3 3 2
Row4 1/4
Row5



Sheet2

Date: 1/4

Acct # Cured Follow Up
546 Y N
455 Y N
445 N N
775 Y Y

Totals: 3 1

When I run my macro it enters the data from the total line in sheet 2 in row 5 when I want the date entered into row 4 in column B. Second problem. Sheet 2 is my daily tabulation sheet. It changes daily, I have entered the "TODAY()" function so it can show the correct date always on sheet 2. Now, how can I have the "TODAY()" function match the date inputed in column A of sheet 1. What I would like is for Sheet 2 to recognize the date from sheet 1 and input the data into the corresponding row for that date. No luck yet in figuring that out. I need help! So if anyone can figure this out, that would be great. Here is the macro I am using thus far. It just inputs the data in the last totally blank row, which I do not want. Thanks again. Please help.


Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function
Sub copy_1()
Dim sourceRange As Range
Dim destrange As Range
Dim Lr As Long
Lr = LastRow(Sheets("Chambers")) + 1
Set sourceRange = Sheets("Sheet1").Range("d30:i30")
Set destrange = Sheets("Chambers").Range("d" & Lr)
sourceRange.Copy destrange
End Sub
Sub copy_1_Values_PasteSpecial()
Dim sourceRange As Range
Dim destrange As Range
Dim Lr As Long
Application.ScreenUpdating = False
Lr = LastRow(Sheets("Chambers")) + 1
Set sourceRange = Sheets("Sheet1").Range("d30:i30")
Set destrange = Sheets("Chambers").Range("d" & Lr)
sourceRange.Copy
destrange.PasteSpecial xlPasteValues, , False, False
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Sub copy_1_Values_ValueProperty()
Dim sourceRange As Range
Dim destrange As Range
Dim Lr As Long
Lr = LastRow(Sheets("Chambers")) + 1
Set sourceRange = Sheets("Sheet1").Range("d30:i30")
With sourceRange
Set destrange = Sheets("Chambers").Range("d" & Lr). _
Resize(.Rows.Count, .Columns.Count)
End With
destrange.Value = sourceRange.Value
End Sub


 
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
Macro or Formula to have a cell match the date on the tab. Cindy Microsoft Excel Misc 4 30th Sep 2009 07:56 PM
How do I include a date input box in a macro? Project Mgr Microsoft Excel Misc 6 19th Jun 2008 04:52 PM
format Access date field to match Access calendar input =?Utf-8?B?TGluZGFPU1U=?= Microsoft Access Queries 4 15th Dec 2005 02:48 AM
Add form to input date and export records from database that match =?Utf-8?B?c2doYXJyaXM0OQ==?= Microsoft Access 0 27th Nov 2005 09:51 PM
User input macro for a date. StargateFanFromWork Microsoft Excel Discussion 5 5th May 2005 04:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:21 PM.