View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Decrease file size

I took a look at CopyData2 and CopyData.

There was the obvious difference of rngD vs. rngE. But after I changed this, I
could see these differences:

LookIn:=xlFormulas, _
LookIn:=xlValues, _

rng.Offset(2, 0).ClearContents
rng.Offset(1, 0).ClearContents

rng3.Resize(nrow * 2, 0).EntireRow.Insert
rng3.Resize(nrow * 2, 1).EntireRow.Insert

Cells(cell.Row, 1).Range("A9,B9").Copy _
Cells(cell.Row, 1).Resize(1, 2).Copy _

Destination:=Sh.Cells(rw, 3)
Destination:=Sh.Cells(rw, 1)

The first one looks like it could be xlformulas in both routines.
The clearcontents looks different enough to me to be important.
The .entirerow.insert (resized to 0 columns looks like an error that should
be fixed)
the "a9,b9" and resize(1,2) are equivalent
the last one looks important.

You could pass a single routine a flag that says which way to process the data.

But if you're really looking to reduce the size of the workbook, try removing
all the code and saving the workbook. Then compare it to the same workbook with
the code. My bet is that it isn't significant.






"gavmer <" wrote:

Thank you all.

Can this code be downsized??? It is still very complicated to look at.
Whilst im an amateur, it still looks to be repeating the same task but
with a different range. Can it be simplified?? One button maybe???

Cheers!!!

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson