LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 14
Default VBA connected vs disconnected from network?

Cross posted from Excel.Programming

Anyone know why some code would work fine when not plugged into my
company’s LAN, but not when I am plugged into the LAN? I mean, other
than Macro Security, is there something else I should be checking?
The
Macro Security shows medium in either condition, but the code will
not
work when I am on the LAN… And while I'm here, anyone know what to
change in NumberFormat so a
currency symbol will be displayed with negative figures as well as
positive?

Thanks, Troy

Here is the code:

Private Sub Worksheet_Calculate()
Const CURRENCYTYPES As String = ":GBP£:JPY¥:EUR€:USD$:CAD$:MEX$:BRL
$:"
Static pv As Variant
Dim cv As Variant


cv = Me.Range("V35").Value2


'unless the current value (cv) is a 4-char string different than
the
cached
'previous value (pv), there's nothing to do, so exit quickly
If cv = pv Or VarType(cv) < vbString Or Len(CStr(cv)) < 4 Then
Exit Sub
Else
cv = ":" & cv & ":"
End If


If InStr(1, CURRENCYTYPES, cv, vbTextCompare) 0 Then
Me.Range("F49:AF49").NumberFormat = Mid$(cv, 5, 1) & "_([$ -2] *
#,##0_);_([$ -2] * (#,##0);_([$ -2] * ""-""_);_(@_)"
pv = Mid$(cv, 5, 1)
End If
End Sub
 
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
disconnected chart objects KenRogers Charts and Charting in Excel 0 August 5th 08 08:03 PM
TWO CUSTOM FUNCTIONS NOT BEING CONNECTED FARAZ QURESHI Excel Discussion (Misc queries) 0 January 26th 08 08:21 PM
hangs when connected Gerhard Adendorff Excel Discussion (Misc queries) 0 April 13th 07 06:56 AM
Excel - let search for more than one disconnected word in a cell Milinds Excel Worksheet Functions 1 January 30th 06 11:20 PM
Excel runs slowly, but only when connected to a network Pete Excel Discussion (Misc queries) 3 November 28th 05 08:25 PM


All times are GMT +1. The time now is 11:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"