Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Format Imported Reports

We have reports imported from PC DMIS which are very long. Can someone give
me a macro to delete every 4th row up to R?......? Thank You!!!!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 857
Default Format Imported Reports

Hi,

The following code delete a row at every 4th line. To use it for any other
number of lines simply change the 4 in the first row of code to the number
you want.

To use it select a vacant range of cells in a single column corresponding to
the height of the range you want to insert blank rows iinto and run the
macro. Tools Macro Macros.

Sub InsertRows()
Selection = "=1/MOD(ROW(),4)"
Selection = Selection.Value
Selection.SpecialCells(xlCellTypeConstants, 16).EntireRow.Delete
Selection.EntireColumn.Delete
End Sub

This code runs extremely fast.

To add this code to a workbook:
1. Press Alt+F11 (opens the Visual Basic Editor)
2. Select your file in the Project - VBA Project window, top left (press
Ctrl+R if you do not see it.)
3. Choose Insert Module
4. Copy the code above to the module on the right

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Dave R" wrote:

We have reports imported from PC DMIS which are very long. Can someone give
me a macro to delete every 4th row up to R?......? Thank You!!!!

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
Imported data Date Format BT[_2_] Excel Discussion (Misc queries) 4 October 30th 08 01:39 PM
Imported Date Format Lee New Users to Excel 3 February 20th 08 05:52 AM
Import Reports in .txt format [email protected] Excel Discussion (Misc queries) 2 November 16th 06 04:43 AM
How to format imported data Erika Palmquist Excel Discussion (Misc queries) 4 October 12th 06 04:04 PM
Automatically modifying imported reports waterskyle Excel Discussion (Misc queries) 1 December 7th 05 11:37 AM


All times are GMT +1. The time now is 01:33 PM.

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

About Us

"It's about Microsoft Excel"