PC Review


Reply
Thread Tools Rate Thread

Data Clean-up

 
 
garret@garretkamenar.com
Guest
Posts: n/a
 
      23rd Nov 2006
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 With Quote
 
 
 
 
Stephen Rasey
Guest
Posts: n/a
 
      23rd Nov 2006
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


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I clean up my data? =?Utf-8?B?dmVudXMgYXMgYSBib3k=?= Microsoft Access 5 26th Dec 2008 11:47 PM
clean up data BNT1 via OfficeKB.com Microsoft Excel Misc 1 14th Feb 2007 03:43 PM
Clean data =?Utf-8?B?anVsaWFsYXR0ZQ==?= Microsoft Access VBA Modules 6 26th Apr 2006 10:47 PM
Get out clean XML data =?Utf-8?B?RGlhbmU=?= Microsoft Excel Misc 1 30th Apr 2005 02:18 PM
Clean data =?Utf-8?B?TWF1cmljZQ==?= Microsoft Access Queries 2 12th Apr 2005 06:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:17 AM.