Excel Custom format

JSH720

Board Regular
Joined
Oct 9, 2009
Messages
107
Office Version
  1. 365
Platform
  1. Windows
I have data that looks like this 13N25W25. I want it to look like this 13N 25W-25. How do I build a custom format or something to change it automatically? I also have data that looks like 13N 25W 25.in the same column. it all should be formatted the same. Thanks.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I have data that looks like this 13N25W25. I want it to look like this 13N 25W-25. How do I build a custom format or something to change it automatically? I also have data that looks like 13N 25W 25.in the same column. it all should be formatted the same. Thanks.
You cannot format that cell as it contains text (you can only format numbers in Excel). Here is a formula solution (which means your values are in a different column)...

=SUBSTITUTE(SUBSTITUTE(A1,"N","N "),"W","-")

We can add more SUBSTITUTE calls if you need to handle S and E. Also, if you want to change the values directly within the cells themselves, you can use a VBA macro (if you want to run it manually) or event code (if you want the change to happen automatically), but in order to write it, we need to know where your data is on the worksheet.
 
Upvote 0
I saw that I never thanked you, my apologies. Thank you so much! I would be interested in the event code and VBA code. The date is all in one column. I have multiple spreadsheets that I would need to do it on, but the data is always on one column on an individual spreadsheet. So I would add whichever code, event ofr VBA, that I use for each spreadsheet.

Thanks.
 
Last edited:
Upvote 0
I saw that I never thanked you, my apologies. Thank you so much! I would be interested in the event code and VBA code. The date is all in one column. I have multiple spreadsheets that I would need to do it on, but the data is always on one column on an individual spreadsheet. So I would add whichever code, event ofr VBA, that I use for each spreadsheet.
Are the multiple spreadsheets all in one workbook? If so, I can write an event for the workbook that would handle the individual sheets... that way you would only have one event procedure handling all of your sheets instead of having to have multiple individual event procedures (one per worksheet). The only problem with doing it this way is i need to know the names of each worksheet and which column on each worksheet that needs to be covered by the procedure. Alternately, if the column on each worksheet has a header cells which is identically the same on each sheet, I can have the code look for that text on the header row (is that row 1 on your worksheets?) and let the code determine which column needs to be monitored. Since I don't know the layout of your sheets, you need to guide me on this.
 
Upvote 0
Here they are:
WORKCOPY (Kyle Edit )
NOTES
Kyle Edit ORIG
SCHEDULE
MAP
TX ROBERTS MORSE
HE-4891
HE-L102569
NT SOLD1
DI WELLSRANCH ET AL
BERGERT AND MORE
BE-12N21W
HE_LSE_605-239
MD
RM_ASSGN
UNIQUE DESC
NT SOLD2
DE_ ASSGN
CU-ASSGN
WA_ASSIGN
RO_ASSIGN
HE_ASSIGN

I will need to do this over time multiple times to update spreadsheets. Also, I'll need to be able to do on other spreadsheets as I work on other projects.

This will be a godsend, so I thank you in advance.



<colgroup><col></colgroup><tbody>
</tbody>
 
Upvote 0
Here they are:
WORKCOPY (Kyle Edit )
NOTES
Kyle Edit ORIG
SCHEDULE
MAP
TX ROBERTS MORSE
HE-4891
HE-L102569
NT SOLD1
DI WELLSRANCH ET AL
BERGERT AND MORE
BE-12N21W
HE_LSE_605-239
MD
RM_ASSGN
UNIQUE DESC
NT SOLD2
DE_ ASSGN
CU-ASSGN
WA_ASSIGN
RO_ASSIGN
HE_ASSIGN

<colgroup><col></colgroup><tbody>
</tbody>
What are these? If they are sheet names, I need to know the column on each of them that the event procedure needs to monitor.
 
Upvote 0

Forum statistics

Threads
1,214,968
Messages
6,122,509
Members
449,089
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top