worksheet change macro working in 64-bit windows 10 PC, but not working in another 32-bit windows 7 PC

cbk40060

New Member
Joined
Jul 5, 2018
Messages
13
I am using the a worksheet change macro to speed up entering totals of different denominations of currencies in around thirty cash counters.
The code of the worksheet change macro is as under:
'========================================================
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Integer
Dim s As Integer
Dim t As Integer
'Determine if change was made to cell H6
  If Not Intersect(Target, Range("H6")) Is Nothing Then
        On Error GoTo Safe_Exit
        Application.EnableEvents = False
    'Determine if the value in Range("D7") is greater than zero
     If Range("H6").Value > 0 Then
            r = Range("H6").Value
            s = r + 9
            t = r + 10
            Range("K" & t).Value = Range("I6").Value
            Range("H" & t & ":I" & t).Interior.ThemeColor = xlThemeColorAccent6
            Range("H" & t & ":I" & t).Interior.TintAndShade = -0.249977111117893
                If s > 10 Then
                    Range("H11" & ":I" & s).Interior.Pattern = xlNone
                End If
            Range("H6").ClearContents
      End If
  End If
Safe_Exit:
    Application.EnableEvents = True
End Sub
'===========================
After I enter the number of currency notes in Range(“H2:H5”), In cell “H6”, I enter the Sl. No. of the cash counter to which the total in Range(“I6”) is to be copied in column “K”.
For example, if I enter 2 in Range(“H6”), the cell ”K12” will be updated with the value in Range(“I6”).
Similarly if I enter 4 in Range(“H6”), the cell ”K14” will be updated with the value in Range(“I6”).

After updating column K, the value in Range(“H6”) will be deleted.

Again I can enter different values in Range(“H2:H6”), and appropriate rows in column “K” will be updated with the value in cell “I6”, depending upon the value in cell “H6”.

This cycle can be repeated many times.


This worksheet macro is working as per my requirements in a 64-bit windows 10 PC, with Office 2007.

But when I copy the same macro in another 32-bit windows 7 PC, as soon as I enter anything in any cell in the worksheet, excel hangs and closes.

I do not know what is going wrong in the other Windows 7 PC.

Please help me to make it work in the 32-bit windows 7 PC.

-CHANDRASHEKHAR.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,215,461
Messages
6,124,955
Members
449,199
Latest member
Riley Johnson

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