Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default adding brackets to every cells without changing content

hi, i want to add brackets to some rows in my spreadsheet, i have tried ="("&A1&")", the thing is, some of my figures appear as small decimal (e.g. 8.63E-07) and and after using ="("&A1&")", it will change my figure to (0.000000863). is there anyway to present it as (8.63E-07)?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 143
Default adding brackets to every cells without changing content

If you want to preserve the exact format of the source cell, consider using the following User Defined Function:

Public Function txet(R As Range) As String
Application.Volatile
txet = "(" & R.Text & ")"
End Function


User Defined Functions (UDFs) are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the UDF will be saved with it.

To remove the UDF:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To use the UDF from Excel:

=txet(A1)

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

or

http://www.cpearson.com/excel/Writin...ionsInVBA.aspx
for specifics on UDFs



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
Changing Content in one coulumn using given content in another Colin Hayes Excel Worksheet Functions 4 March 28th 10 11:28 PM
Prevent formula from changing when adding in cells Rhett C[_2_] Excel Discussion (Misc queries) 2 October 2nd 09 09:35 PM
adding the same formula to several cells without changing cell lin rcc Excel Discussion (Misc queries) 7 October 17th 07 08:31 PM
adding quotations / brackets kvedros Excel Worksheet Functions 1 November 6th 06 06:42 AM
changing the colour of cells depending on the content. johnny.exe Excel Discussion (Misc queries) 3 January 26th 06 09:41 AM


All times are GMT +1. The time now is 05:08 AM.

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"