If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
cell format problem
Hi there,
Is it possible to format cell for to make one character empty space between each character. for example: if I write in to any cell H5F2 then must shown like H 5 F 2 thanks in advance necip --- Message posted from http://www.ExcelForum.com/ |
#2
|
|||
|
|||
Hi
not possible with a format. This would require VBA -- Regards Frank Kabel Frankfurt, Germany Hi there, Is it possible to format cell for to make one character empty space between each character. for example: if I write in to any cell H5F2 then must shown like H 5 F 2 thanks in advance necip --- Message posted from http://www.ExcelForum.com/ |
#3
|
|||
|
|||
If your data is only 4 digits you can use formula:
=LEFT(A1,1) & " " &MID(A1,2,1) & " " &MID(A1,3,1) & " " & MID(A1,4,1) just a thought,, "necip " wrote in message ... Hi there, Is it possible to format cell for to make one character empty space between each character. for example: if I write in to any cell H5F2 then must shown like H 5 F 2 thanks in advance necip --- Message posted from http://www.ExcelForum.com/ |
#4
|
|||
|
|||
On Wed, 8 Sep 2004 01:24:30 -0500, necip
wrote: Hi there, Is it possible to format cell for to make one character empty space between each character. for example: if I write in to any cell H5F2 then must shown like H 5 F 2 thanks in advance necip I don't know of any way to do this with formatting. One approach would be to write an event-triggered VBA routine that adds the spaces. This would, of course, turn the result into something different than what you entered. In other words, H5F2 is not the same as H 5 F 2. If you want to use that approach, the below code can do it. Set aoi to whatever range(s) you want displayed this way. To enter the code, right-click on the worksheet tab and select View Code. Paste the code below into the window that opens. ================================== Private Sub Worksheet_Change(ByVal Target As Range) Dim aoi As Range Dim c As Range Dim i As Integer Dim temp As String Dim temp2() Set aoi = [A:A] 'change this to reflect area to be formatted this way Application.EnableEvents = False If Not Intersect(Target, aoi) Is Nothing Then For Each c In Target If Not Intersect(c, aoi) Is Nothing Then temp = Replace(c.Text, " ", "") ReDim temp2(Len(temp)) For i = 0 To Len(temp) - 1 temp2(i) = Mid(temp, i + 1, 1) Next i c.Value = Join(temp2) End If Next c End If Application.EnableEvents = True End Sub ======================================== --ron |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with difference between blank and empty cell | balraj | Worksheet Functions | 1 | May 15th, 2004 10:53 AM |
format cell reverts to previous format | rfs | Worksheet Functions | 1 | January 14th, 2004 05:33 PM |
method to copy cell format through formula/VBA? | Paul Moles | Worksheet Functions | 0 | January 8th, 2004 12:12 PM |
set cell format in user function | Vasant Nanavati | Worksheet Functions | 0 | November 24th, 2003 03:33 PM |