View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Changing cell data with macro--HELP!!!!


"AaronT" skrev i en meddelelse
...
Hello all,

Please help me out with this. I have a worksheet that needs to be
uploaded into an IBM AS/400 system. Cells that will be uploaded are
marked with yes to tell the AS/400 to accept this data. Once
uploaded,
I have to mark the each cell in Col F with a date so that they will
not be uploaded again and overwrite the previously uploaded data. An
example of my worksheet is as follows:


E
F G
Period End Date Upload Date Upload Data
5/11/2007 --blank-- Yes
6/15/2007 --blank-- No


(There are usually around 100 - 175 rows like this)


I would like to create a macro that would ask the user for the period
end date and upload date, the find all cells with that same period
end
date that are marked Yes for upload and put in the upload date
automatically. Any help that you can provide is appreciated. I will
try to upload the sheet if possible for further illustration.


Hi

Try if this macro works.

Option Explicit

Dim EndDate As Date
Dim UploadDate As Date
Dim tRange As Range
Dim c As Variant

Sub Enter_Upload_Date()
EndDate = InputBox("Enter end date : ", "Upload")
UploadDate = InputBox("Enter upload date : ", "Upload")
Set tRange = Range("E2", Range("E2").End(xlDown))

For Each c In tRange
If c.Value = EndDate And c.Offset(0, 2) = "Yes" Then c.Offset(0,
1).Value = UploadDate
Next
End Sub

Regards,

Per