vba

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

TrustPilot

starstarstarstarstar Excellent

  • Home
  • Courses
  • Promotions
  • Schedule
  • Formats
  • Our Clients

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VBA

VBA

resolvedResolved · High Priority · Version 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:

Using basic functions without doing formulas

When you highlight figures Autocalc tells you the total in the bottom right of the screen, but if you right click on the sum it will give you some basic functions. The functions are Min, Max, Average, Sum, Count, and Count Nums.

View all Excel hints and tips


Server loaded in 0.08 secs.