Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

STL - Formerly Best Training Solutions Through Learning
TrustPilot
Excellent
Request Callback We will call you back
0207 987 3777 Call for assistance
Your Basket Basket is empty
vba

ResolvedVersion 2003

Saif has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course

VBA

How can I enter a line on the spreadsheet after each customer name?

RE: VBA

Hi Saif

Thank you for your question

First you need to sort the data by customer name.

You then need to move down the data a row at a time until the customer name changes. When that happens

 Rows(intRowCount).Insert 


Will insert a row in the relevant place.

Note inserting a row will disrupt the current region, and so you cannot use the count method to determine how many rows there are. I suggest

 Do until cells(intRowCount,1).Value = "" 


as a looping structure. The code will run until it encounters an empty cell.

Regards

Stephen

Mon 29 Jun 2009: Automatically marked as resolved.

Excel tip:

DATEDIF function

The DATEDIF function is a worksheet function that computes the difference between two dates. This function is documented only in the help files for Excel 2000. It isn't documented in Excel 2002.
the formula function is:
=DATEDIF(Your age,Today(),"Y")
Y stands for year

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.