Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calculating and copying data into new sheet


Thank you very much for your help and the code. Works perfectly.
I can see how the columns are calculated in the export page - ver
impressive.

I am perhaps asking the impossible here but here goes...

I see in your formula you are looking for an output in each chang
within column A,
is there anyway you can say in the VBA that you only want to repor
each change in column A when, for example column B is 1/12/2003 ?

Many thanks again,

Scott

--
scottwilson
-----------------------------------------------------------------------
scottwilsonx's Profile: http://www.excelforum.com/member.php...fo&userid=1112
View this thread: http://www.excelforum.com/showthread.php?threadid=26382

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Calculating and copying data into new sheet

Scott,

Not sure what you mean by change (or report), but you can use something like
the below. Note that the date in the line

If CLng(myCell(1, 2).Value) = CLng(DateValue("12/1/2003")) Then

must be entered as a US-style date: mm/dd/yyyy, not dd/mm/yyyy - that's just
VBA.

HTH,
Bernie
MS Excel MVP

Sub TryNow2()
Dim myCell As Range
Dim myRange As Range
Dim i As Long
Dim mySht As Worksheet
Dim DataSht As Worksheet

Set DataSht = ActiveSheet

On Error Resume Next
Worksheets("New Data Set").Delete

Set mySht = Worksheets.Add
mySht.Name = "New Data Set"

For Each myCell In DataSht.Range(DataSht.Range("A2"), _
DataSht.Range("A65536").End(xlUp))
If CLng(myCell(1, 2).Value) = CLng(DateValue("12/1/2003")) Then
For i = CLng(myCell(1, 2).Value) To CLng(myCell(1, 3).Value)
mySht.Range("A65536").End(xlUp)(2).Value = myCell.Value
mySht.Range("B65536").End(xlUp)(2).Value = i
mySht.Range("C65536").End(xlUp)(2).Value = myCell(1, 4).Value
mySht.Range("D65536").End(xlUp)(2).Value = myCell(1, 5).Value
Next i
End If
Next myCell

mySht.Range("B:B").NumberFormat = "dd/mm/yyyy"
End Sub



"scottwilsonx" wrote in message
...

Thank you very much for your help and the code. Works perfectly.
I can see how the columns are calculated in the export page - very
impressive.

I am perhaps asking the impossible here but here goes...

I see in your formula you are looking for an output in each change
within column A,
is there anyway you can say in the VBA that you only want to report
each change in column A when, for example column B is 1/12/2003 ?

Many thanks again,

Scott.


--
scottwilsonx
------------------------------------------------------------------------
scottwilsonx's Profile:

http://www.excelforum.com/member.php...o&userid=11128
View this thread: http://www.excelforum.com/showthread...hreadid=263823



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
Need help Taking alot data from one sheet (if not blank) and copying toa list on another sheet. Alex Zuniga Excel Worksheet Functions 1 November 25th 09 11:54 PM
Copying the repeated data of the previous sheet to the next sheet Sasikiran Excel Discussion (Misc queries) 1 September 25th 07 03:18 PM
Copying Data from one sheet to another sheet on a specific day Gav123 Excel Worksheet Functions 0 May 1st 07 10:17 AM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM
Calculating and copying data into new sheet scottwilsonx[_38_] Excel Programming 1 September 27th 04 03:42 PM


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