Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Repost:replacing data on a non focused worksheet with calculated data from the same sheet
I have the following code:
Public Sub showtimer() numberofrows = Sheets("15min").UsedRange.Rows.Count mydate = Sheets("15min").Range("A" & numberofrows) If DateValue(mydate) = DateValue(Date) Then With Sheets("15min").Range("A2:G2") 'this needs to be updated with calculating data .Parent.Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Resize(1, 7).Value = .Value End With Else With Sheets("15min").Range("A2:G2") .Parent.Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Resize(1, 7).Value = .Value End With MsgBox ("Add Date") End If With Sheets("15min").Range("k2:q2") .Parent.Range("k" & Rows.Count).End(xlUp).Offset(1, 0).Resize(1, 7).Value = .Value End With theevent = "showtimer" incrementTimer Call OntimeManager("ADD", nowplus, "showtimer", nowplus1) End Sub What it does is to copy 2 sections from the top of the page to the bottom of the page. On row is static (this is what I need to update) and then K-Q had data that changes. What I need to do is to replace the section: If DateValue(mydate) = DateValue(Date) Then With Sheets("15min").Range("A2:G2") 'this needs to be updated with calculating data .Parent.Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Resize(1, 7).Value = .Value End With Else With Sheets("15min").Range("A2:G2") .Parent.Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Resize(1, 7).Value = .Value End With MsgBox ("Add Date") End If so that if it is the first time for the day, it will stuff B - G with 0 and then A with the date and time, and if it is any other entry, it will replace A with the date/time, b = L current row - L of prev row C = M current row - M of prev row D = N current row - N of prev row etc to G. I need this to happen while I am focused on a different work sheet. This is pretty much what is causing me the problems... Thanks Bruce |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Repost - Functions on filtered data | Excel Worksheet Functions | |||
Imported Data Not Replacing Existing Data - Excel 2007 | Excel Discussion (Misc queries) | |||
Data Validation - repost | Excel Discussion (Misc queries) | |||
Closing the current focused sheet | Excel Discussion (Misc queries) | |||
replacing data on a non focused worksheet with calculated data from the same sheet | Excel Programming |