View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default Build a Macro that uses keystrokes

You do not need to use keystrokes to do what you need. You can use
Trim(ActiveCell.Value), or somethign similar, to get rid of all
unnecessary spaces. ActiveCell wouldn't be my first choice though.
You could use a For Next loop to cycle through the column containing
the screwed up cells. HTH
King Ki wrote:
I need to write some macros that are based on keystrokes. I've done it in
other spreadsheets, but can not figure out how to do it in Excel 2003. As an
example, I import delimited files and sometimes they must be edited to format
correctly. If the field has <blank<blank12:30:30, it is viewed as a text
field. To correct this I need to remove the leading blanks. The keystrokes
would be <F2<Home<Del<Del<Enter. This should take me to the next field
and able to repeat the macro. When I record the macro it give me a hard
value of 12:30:30.