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


I have a worksheet that I have been working on for about a week.
It near completion and now i have had several times that my formulas
are disapearing.

I wonder if it could have any thing to do with the VB code that I added
I have two different sets of codes on different worksheets.

I one I think might be doing it is the Upper Case code. I think i only
need one part of it and maybe they are causing problems. I deleted the
first code and it seems to work. If someone could look at it and let me
know if they think this could be causing it.

The second code is on a spread worksheet inside of the same workbook.


UPPERCASE UPON ENTER:

Sub Uppercase()

For Each x In Range("a17:av82")
x.Value = UCase(x.Value)
Next



End Sub

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column 50 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
ErrHandler:
Application.EnableEvents = True
End Sub

Absolute Reference VB Code:

Sub Absolute()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlAbsolute)
End If
Next
End Sub

Sub AbsoluteRow()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlAbsRowRelColumn)
End If
Next
End Sub

Sub AbsoluteCol()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlRelRowAbsColumn)
End If
Next
End Sub

Sub Relative()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlRelative)
End If
Next
End Sub


--
lostinformulas
------------------------------------------------------------------------
lostinformulas's Profile: http://www.excelforum.com/member.php...o&userid=35229
View this thread: http://www.excelforum.com/showthread...hreadid=552507

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Disapearing formulas

Hi LostInFormulas,

Try replacing

Sub Uppercase()

For Each x In Range("a17:av82")
x.Value = UCase(x.Value)
Next

End Sub


with

'=============
Public Sub Uppercase()
Dim SH As Worksheet
Dim Rng As Range
Dim rCell As Range

Set SH = ThisWorkbook.Sheets("Sheet1") '<<==== CHANGE

Application.EnableEvents = False
On Error Resume Next
Set Rng = SH.Range("A17:AV82"). _
SpecialCells(xlCellTypeConstants, xlTextValues)
On Error GoTo XIT

If Not Rng Is Nothing Then
For Each rCell In Rng.Cells
With rCell
.Value = UCase(.Text)
End With
Next rCell
End If

XIT:
Application.EnableEvents = True
End Sub
'<<=============


---
Regards,
Norman


"lostinformulas"
<lostinformulas.29gv7c_1150413603.0828@excelforu m-nospam.com wrote in
message news:lostinformulas.29gv7c_1150413603.0828@excelfo rum-nospam.com...

I have a worksheet that I have been working on for about a week.
It near completion and now i have had several times that my formulas
are disapearing.

I wonder if it could have any thing to do with the VB code that I added
I have two different sets of codes on different worksheets.

I one I think might be doing it is the Upper Case code. I think i only
need one part of it and maybe they are causing problems. I deleted the
first code and it seems to work. If someone could look at it and let me
know if they think this could be causing it.

The second code is on a spread worksheet inside of the same workbook.


UPPERCASE UPON ENTER:

Sub Uppercase()

For Each x In Range("a17:av82")
x.Value = UCase(x.Value)
Next



End Sub

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column 50 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
ErrHandler:
Application.EnableEvents = True
End Sub

Absolute Reference VB Code:

Sub Absolute()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlAbsolute)
End If
Next
End Sub

Sub AbsoluteRow()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlAbsRowRelColumn)
End If
Next
End Sub

Sub AbsoluteCol()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlRelRowAbsColumn)
End If
Next
End Sub

Sub Relative()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlRelative)
End If
Next
End Sub


--
lostinformulas
------------------------------------------------------------------------
lostinformulas's Profile:
http://www.excelforum.com/member.php...o&userid=35229
View this thread: http://www.excelforum.com/showthread...hreadid=552507



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
Disapearing Excel 2003 files on the newtork Mac Excel Discussion (Misc queries) 4 July 11th 08 05:30 PM
text disapearing in a text box Connie Charts and Charting in Excel 0 April 3rd 08 02:35 PM
office 2007 glitch disapearing text Dave S Excel Discussion (Misc queries) 0 December 14th 07 04:16 PM
CELLS NOT CALC FORMULAS - VALUES STAY SME FORMULAS CORRECT?? HELP Sherberg Excel Worksheet Functions 4 September 11th 07 01:34 AM
Saved Excel sheet - information disapearing djbeenie Excel Discussion (Misc queries) 5 December 30th 05 10:31 PM


All times are GMT +1. The time now is 03:54 PM.

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"