Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
To whom it may concern,
I have this issue with one of my VBA files and I just can't figure it out. I have this search and replace macro that does a good job but I can't figure out why it places a negative (-) sign on values without a space after the parentheses. Your help is greatly appreciated. Start example https://docs.google.com/spreadsheets...it?usp=sharing Finished example https://docs.google.com/spreadsheets...it?usp=sharing Sub Discus_Fix() ' ' Discus_Fix Macro ' Replaces redundant information on Discus AS9102 Report Cells.Replace What:="note: ", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
To whom it may concern,
I have this issue with one of my VBA files and I just can't figure it out. I have this search and replace macro that does a good job but I can't figure out why it places a negative (-) sign on values without a space after the parentheses. Your help is greatly appreciated. Start example https://docs.google.com/spreadsheets...it?usp=sharing Finished example https://docs.google.com/spreadsheets...it?usp=sharing Sub Discus_Fix() ' ' Discus_Fix Macro ' Replaces redundant information on Discus AS9102 Report Cells.Replace What:="note: ", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub Your data cells contain text, but are not formatted as 'Text'. Thus, Excel is evaluating (.140) as a number where the parenthesis indicate a negative value. Thus, your data alignment is changed to numeric and displays in your default format for a negative value. -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello Garry,
I appreciate your support. My entire workbook is formatted as "Text" and when I run the macro it converts (.140) to -0.14 and I see the error telling me "Number Stored as Text". Is there a way I can work around this issue? Thanks |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello Garry,
I appreciate your support. My entire workbook is formatted as "Text" and when I run the macro it converts (.140) to -0.14 and I see the error telling me "Number Stored as Text". Is there a way I can work around this issue? Thanks I don't get this conversion behavior when I 'set' the cells to 'Text' on the 'Number' tab of the FormatCells dialog. Perhaps you could 'deliberately' format all cells before replacing... Cells.NumberFormat = "@" Cells.Replace... -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello Garry,
I'd like to thank you for your input and ideas. It finally worked. This is a reference dimension so by putting "REF" at the end it finally solve my issue. It finally sees it as text only :-) Thanks again |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I replace decimals starting with "." to "0." in excel? | Excel Discussion (Misc queries) | |||
How to perform Search and Replace on "Tilde", CHAR(126), ~ | Excel Worksheet Functions | |||
How do display a "+" or "-" sign when hiding columns? | Setting up and Configuration of Excel | |||
turn off the " replace file?" question when saving excel files | Excel Programming | |||
Is there a "replace" or "Substitute" command in Excel's VB? | Excel Programming |