LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 2 VBA enhancements

Hello once again,

I have a very pretty macro now (thanks Duncan, thanks Kaak!)
-------------
Range("G2").Select
Do
If IsNumeric(Trim(ActiveCell.Value)) Then ActiveCell.Value =
Trim(ActiveCell.Value) * 1
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, -1))
-------------

At the present time, I would like however to add two small (general)
enhancements...
1) If I have to repeat the macro for 5 or 6 (or more) columns, I would
prefer not to copy/paste the code x times one after another, changing the
letter from G2 to K2, then M2 etc..., but to create the initial line in VBA
where I could specify a list (f. ex. =[G, K, M, O, P, X]) of columns to
treat with the code... (then modifying the "Range("G2").Select" line to
treat "G" like variable)...

2) Concerning the last line of the code = Loop Until
IsEmpty(ActiveCell.Offset(0, -1))
Is it possible to modify the code to tell:
Loop Until IsEmpty("cell in the same row that ActiveCell, but in the column
A")?


Many thanks in advance to all of you that could give me at least a hint how
to achieve this!!
Mark



 
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
Excel In-cell Enhancements silverliningboy Excel Worksheet Functions 4 May 15th 06 08:58 PM
combining multiple columns into one column - enhancements markx Excel Worksheet Functions 0 February 16th 06 03:12 PM
Pivot Table Enhancements/Fixes in Excel 2003 aanyc Excel Discussion (Misc queries) 1 June 20th 05 09:23 PM
Need Code Enhancements patrick molloy Excel Programming 1 July 17th 03 05:49 PM
Need Code Enhancements Debra Dalgleish[_2_] Excel Programming 1 July 17th 03 03:39 PM


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