#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 622
Default Bad code?

Ok, I am going crazy. Below is a macro I recorded and stored in
Personal.xls, in its entirety. It fixes the garbage that comes in from
an html data source that I must use frequently (online enterprise
software). It seems to cause problems, and I don't know why, it
appears fine and simple. Is there anything wrong with this? Or is this
just SOP for Excel and other people have the same problems? I would
appreciate any insight. (WinXP, Excel 2003, Dell Optiplex)

This is my workflow:
I copy/paste data, run the macro, copy the data to a preformated area
in the same workbook to look pretty, then delete the raw data.

I have a coworker with the same job. She does the same workflow,
except doing it slowly without a macro. None of these problems surface
for her.

Here are the problems I have after running this macro:

1) Redo/Repeat stops working. It says "Repeat Macros" in the Edit
menu, but doesn't actually DO anything when selected. It never changes
from "Repeat Macros", so the Repeat command is lost til I restart
Excel. Menu selection, F4, CTRL-Y, nothing works.
2) It affects the size of the file. I always delete the entire columns
where the download was pasted, yet the workbook keeps growing as if I
leave the full raw data in there every single time I do this. After a
few months, the file has quadrupled in size.
3) It 'sticks' to the file somehow. When I send files to certain
companies, their over-zealous security deletes any emails with
attachments containing macros. These files do not contain this (or
any) macro, it is stored in Personal. Yet the firewalls claim there is
a macro after I run it on these files, and block my emails.


Code:

Sub Clean()
'
' Clean Macro
' Macro recorded 1/25/2007
'

'
Cells.Replace What:=" ", Replacement:="", LookAt:=xlPart,
SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False,
ReplaceFormat:=False
ActiveSheet.DrawingObjects.Delete
Cells.Select
Selection.UnMerge
Selection.WrapText = False
Range("B:IV").Select
Selection.Style = "Comma"
Range("A1").Select

End Sub
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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Slow code when used as VBA code instead of macro (copying visible columns) [email protected] Excel Programming 3 April 2nd 07 05:26 PM
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. Corey Excel Programming 3 December 11th 06 05:14 AM
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... Corey Excel Programming 4 November 25th 06 04:57 AM
Excel code convert to Access code - Concat & eliminate duplicates italia Excel Programming 1 September 12th 06 12:14 AM


All times are GMT +1. The time now is 03:38 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"