Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data Clean-up

I am doing a spredsheet with several different sets of data. These
sets of data are of varying lengths so I recorded a macro that imported
the data and formated it. Because the data is of varying lengths the
macro drags some formulas down to a certain row that will cover all of
the data. My problem is I would like to record a macro that will
delete all of the draged formulas that go past the end of the data set.
Just clean up the rows that don't have the data in them. Can any one
help me?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Data Clean-up

Can you first delete the formulas from the 2nd row to the bottom?
Then copy the formulas down the current range.

Set rngDataTop = cell that is the top of the data range.
Set rngFormulaTop = cell that is the top of the formula range you want to
copy down
Set rngData = Range(rngDataTop,rngDataTop.end(xldown))
Set rngFormulas = range(rngFormlaTop,rngFormulaTop.end(xldown))
nrows = rngData.rows.count

'clear the formulas
rngFormulas.offset(1,0).clear

'Copy the formulas to the length of data.
rngFormulaTop.copy rngFormulaTop.offset(1,0).resize(nrows-1)

-Stephen Rasey
Houston


wrote in message
oups.com...
I am doing a spredsheet with several different sets of data. These
sets of data are of varying lengths so I recorded a macro that imported
the data and formated it. Because the data is of varying lengths the
macro drags some formulas down to a certain row that will cover all of
the data. My problem is I would like to record a macro that will
delete all of the draged formulas that go past the end of the data set.
Just clean up the rows that don't have the data in them. Can any one
help me?





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
How to clean one book using data from another? AFSA Ad Intern New Users to Excel 4 June 17th 08 02:57 AM
Data Clean Up Dolphy Excel Discussion (Misc queries) 1 September 28th 07 10:47 AM
clean up data BNT1 via OfficeKB.com Excel Discussion (Misc queries) 1 February 14th 07 03:43 PM
Clean Up Data ultra_xcyter Excel Discussion (Misc queries) 2 August 11th 06 08:49 PM
Get out clean XML data Diane Excel Discussion (Misc queries) 1 April 30th 05 02:18 PM


All times are GMT +1. The time now is 01:13 AM.

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"