Solved

Accumulate data at cell

Posted on 2010-11-15
5
684 Views
Last Modified: 2012-05-10
Hi Experts,

I would like to request Experts help to add additional feature in the attached script. Need to copy and accumulate date value from Column_C at Send sheet to Status sheet at Column B and Column_C at Return sheet to Status sheet at Column C and update column D with the latest location sheet of the number. I have attached the sample data at Status sheet for Experts to get better view. Hope Experts will help me to add this feature.



Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 1 Then
        Target.Offset(1, 0).Select
    End If
    If Target.Row < 3 Then Exit Sub
    If Not Application.Intersect(Target, Columns(1)) Is Nothing Then
        Target.Offset(, 1) = Environ("username")
        Target.Offset(, 2) = Now()
      
        With Worksheets("Status")
            Set r = .Columns(1).Find(Target.Offset(, 0), LookIn:=xlValues)
            If r Is Nothing Then
                rn = .UsedRange.Rows.Count + 1
                .Cells(rn - 1, 1).Copy .Cells(rn, 1)
                .Cells(rn, 1).Value = Target.Offset(, 0)
            End If
        End With
    End If
End Sub

Open in new window

DataCopy.xls
0
Comment
Question by:Theva
  • 3
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
Peter Kwan earned 500 total points
ID: 34142554
Please try. But one point to note, if you add two rows of the same CNumber in the same day (e.g. 16-Nov), then there will be "16-Nov;16-Nov" in the same cell.
DataCopy.xls
0
 

Author Comment

by:Theva
ID: 34142905
Hi,

Thanks for the code. I noticed at Status sheet when we update the C-number its always copying the row 2 cell format (color and font type) how to prevent this?  
0
 
LVL 16

Expert Comment

by:Peter Kwan
ID: 34142923
Just remove the two lines:

.Cells(rn - 1, 1).Copy .Cells(rn, 1)
.Cells(rn - 1, 3).Copy .Cells(rn, 3)
0
 

Author Closing Comment

by:Theva
ID: 34143201
Hi,

Thanks a lot for the superb solution
0
 

Author Comment

by:Theva
ID: 34163592
Hi,

Hope you will consider this request. Intent to integrate new feature  with your solution.

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_26623691.html
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Slight Modification to Macro 2 15
combo box dependant userform submit button 24 28
integer8 values 1 10
Gantt chart 2 14
Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now