Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to append En Spaces

Hi,

I'm trying to write a macro that will append special characters (two en
spaces) to the beginning of the text in each highlighted cell. I am new
to vba, and I am not having much luck. Does anyone have any ideas or
hints for how to do this?

Thanks,
Dan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Macro to append En Spaces

Hi Dan,

Dan wrote:
I'm trying to write a macro that will append special characters (two
en spaces) to the beginning of the text in each highlighted cell. I
am new to vba, and I am not having much luck. Does anyone have any
ideas or hints for how to do this?


I don't know the character code for an en space, but here's some code that
should do what you're looking for (replace 50 with the character code that
corresponds to en space):

Public Sub gPrependEmSpaces()
Dim c As Range

For Each c In Selection
If Len(c.Value) 0 And Not c.HasFormula Then
c.Value = Chr(50) & Chr(50) & c.Value
End If
Next c
End Sub

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]


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
Copy and Append Macro Excel Help! Excel Discussion (Misc queries) 2 April 7th 08 05:39 PM
append two worksheets with excel macro Moon Excel Programming 0 March 22nd 05 09:47 PM
use macro to append records to worksheet goingtospace Excel Programming 0 December 2nd 04 01:12 PM
macro to append one cell to another billbeecham[_2_] Excel Programming 0 November 11th 04 07:45 PM
macro to append one cell to another billbeecham Excel Programming 4 November 10th 04 01:23 PM


All times are GMT +1. The time now is 04:12 PM.

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"