ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro for Customer response time (https://www.excelbanter.com/excel-programming/282556-macro-customer-response-time.html)

Bren.ie

Macro for Customer response time
 

I have an Excel spreadsheet with a list of customers with a number o
transaction dates listed for each customer.

I want to write a macro to subtract the initial contact date from th
final contact date (and identify the number of days between both dates
for each customer.

Can anyone help

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


ben.c

Macro for Customer response time
 
hi,
i have suppose than your name are in column1, your initial date column 2 and your last date column 3...
And i have just made a programe which will put in column 4 = column3 - column 2...then change the format of column 4 in number to have the number of day.....If i did not understand what you have ask, please describe more your spreadsheet.

public numberofday()

Range("D2").Select
ActiveCell.FormulaR1C1 = "=RC[-2]-RC[-1]"
Range("D2").Select
Selection.AutoFill Destination:=Range("D2:D400"), Type:=xlFillDefault
Columns("D:D").Select
Selection.NumberFormat = "0"

end sub

Bren.ie[_2_]

Macro for Customer response time
 

Thank you "~x" for your reply.
Unfortunately all the transaction dates appear in one column.

I need the macro to identify the first and last transaction dates for
each customer and subtract them.

I hope I'm not looking for the impossible.

With thanks

~× wrote:
*hi,
i have suppose than your name are in column1, your initial date
column 2 and your last date column 3...
And i have just made a programe which will put in column 4 = column3
- column 2...then change the format of column 4 in number to have the
number of day.....If i did not understand what you have ask, please
describe more your spreadsheet.

public numberofday()

Range("D2").Select
ActiveCell.FormulaR1C1 = "=RC[-2]-RC[-1]"
Range("D2").Select
Selection.AutoFill Destination:=Range("D2:D400"),
Type:=xlFillDefault
Columns("D:D").Select
Selection.NumberFormat = "0"

end sub *



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



All times are GMT +1. The time now is 03:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com