Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default 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
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
Repost - Functions on filtered data LiAD Excel Worksheet Functions 0 March 25th 10 04:34 PM
Imported Data Not Replacing Existing Data - Excel 2007 Marilyn Excel Discussion (Misc queries) 0 April 27th 09 05:22 PM
Data Validation - repost RaulDR Excel Discussion (Misc queries) 2 September 9th 08 11:33 AM
Closing the current focused sheet Pietro Excel Discussion (Misc queries) 3 February 22nd 07 11:15 PM
replacing data on a non focused worksheet with calculated data from the same sheet BruceJ[_2_] Excel Programming 0 November 5th 03 05:00 PM


All times are GMT +1. The time now is 08:00 AM.

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"