Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
NoviceIan
 
Posts: n/a
Default Macro to delete

Hi, I've never used Macros in Excel before and need to start now.

Basically every so often I receive a list of patients from GP practices in
Excel documents. The list is dumped in from GP systems and often needs
sorting. The main problem with the lists is that there are often several
empty rows between each patient.

We use these lists for mail merge purposes and the blank rows cause havoc.
I would like to create a macro that will search through the patients and
delete the empty rows. I tried using the code from one of the other threads.
It did what I wanted but I could not stop it.

Please can somebody help.

Thanks

Ian
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Sub myMacro()
Dim rng As Range
Set rng = Range("A1").Resize(Cells(Rows.Count, "A"). _
End(xlUp).Row).SpecialCells(xlCellTypeBlanks)
rng.Delete
End Sub

This assumes that column A is the key column.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"NoviceIan" wrote in message
...
Hi, I've never used Macros in Excel before and need to start now.

Basically every so often I receive a list of patients from GP practices in
Excel documents. The list is dumped in from GP systems and often needs
sorting. The main problem with the lists is that there are often several
empty rows between each patient.

We use these lists for mail merge purposes and the blank rows cause havoc.
I would like to create a macro that will search through the patients and
delete the empty rows. I tried using the code from one of the other

threads.
It did what I wanted but I could not stop it.

Please can somebody help.

Thanks

Ian



  #3   Report Post  
NoviceIan
 
Posts: n/a
Default

Thats excellent thanks alot that will save an aweful lot of tedious work.

"Bob Phillips" wrote:

Sub myMacro()
Dim rng As Range
Set rng = Range("A1").Resize(Cells(Rows.Count, "A"). _
End(xlUp).Row).SpecialCells(xlCellTypeBlanks)
rng.Delete
End Sub

This assumes that column A is the key column.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"NoviceIan" wrote in message
...
Hi, I've never used Macros in Excel before and need to start now.

Basically every so often I receive a list of patients from GP practices in
Excel documents. The list is dumped in from GP systems and often needs
sorting. The main problem with the lists is that there are often several
empty rows between each patient.

We use these lists for mail merge purposes and the blank rows cause havoc.
I would like to create a macro that will search through the patients and
delete the empty rows. I tried using the code from one of the other

threads.
It did what I wanted but I could not stop it.

Please can somebody help.

Thanks

Ian




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
Macro data selection line delete Frantic Excel-er Excel Discussion (Misc queries) 0 May 31st 05 11:46 PM
delete personal macro kalz Excel Discussion (Misc queries) 3 March 22nd 05 03:13 AM
Macro to delete data in 'green' cells only Steve Excel Worksheet Functions 7 March 19th 05 01:40 PM
Cannot delete a macro Jeff B Excel Discussion (Misc queries) 3 February 15th 05 12:43 AM
How to delete a macro that has been assigned to run when workshee. tcsigecan Excel Worksheet Functions 1 December 28th 04 10:11 PM


All times are GMT +1. The time now is 05:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"