spurs
Active Member
- Joined
- Oct 18, 2006
- Messages
- 479
- Office Version
- 2016
- 2013
- 2010
- 2007
- 2003 or older
- Platform
- Windows
I have the following abbreviated code in a worksheet
the intent is that when sub Units_mm_to_in2() is run, the worksheet changes from a metric version to an inch verseion
It as working a few years ago but today it is not functioning. Something gets stuck on the last line:
Application.Calculation = xlCalculationAutomatic ' turns on automatic spreadsheet calculation and does a calc
and excel closes and restarts
I cant seem to figure out why it is doing this now. Possible driver issue?
Any insight would be appreciated
the intent is that when sub Units_mm_to_in2() is run, the worksheet changes from a metric version to an inch verseion
It as working a few years ago but today it is not functioning. Something gets stuck on the last line:
Application.Calculation = xlCalculationAutomatic ' turns on automatic spreadsheet calculation and does a calc
and excel closes and restarts
I cant seem to figure out why it is doing this now. Possible driver issue?
Any insight would be appreciated
VBA Code:
Option Private Module
' the following function is used to select data from 2 different worksheets
' and select which worksheet is active - see D2 sheet for where it is used
Public Function IsVisible(r As Range)
Application.Volatile
IsVisible = r.Worksheet.Visible = xlSheetVisible
End Function
Sub Units_mm_to_in2()
' This subroutine sets the formatting of the worksheet from mm to inches
' The worksheet "holder needs to be set up to look at the "Main in" worksheet for its inputs
Dim A As String
Application.ScreenUpdating = False
A = ActiveCell.Address(0, 0)
Application.Calculation = xlCalculationManual ' turns off autmatic spreadsheet calculation
Sheets("Test Geometry (in)").Range("B2") = Sheets("Test Geometry (mm)").Range("B2") ' customer
Sheets("Test Geometry").Range("B2") = "='Test Geometry (in)'!B2"
Sheets("Test Geometry (in)").Range("G52") = Sheets("Test Geometry (mm)").Range("G52") / 25.4 ' Selected Ball Dia test gear
Sheets("Test Geometry").Range("G52") = "='Test Geometry (in)'!G52 * 25.4"
Sheets("D").Range("E21") = 2
Sheets("D").Range("D4") = 25.4
Sheets("DF Calcs").Range("B42") = "in"
Sheets("CD-TR Chart").Range("F4:K9").NumberFormat = "0.0000"
Sheets("Polar Center Distance Chart").Range("F4:K9").NumberFormat = "0.0000"
Sheets("Test Geometry (in)").Visible = True
Sheets("Test Geometry (in)").Activate
Range(A).Select
Sheets("Test Geometry (mm)").Visible = False
Application.Calculation = xlCalculationAutomatic ' turns on automatic spreadsheet calculation and does a calc
End Sub
Last edited by a moderator: