I am trying to use vba to update a number value in a cell on another excel workbook by 1.
so if I have the value 466 in workbook 2 then when I run my code form workbook 1 this will update 466 to 467, and each time the code is run it gets incremented by 1.
the workbook will normally be closed but I want it to be able to work whether the workbook is open or closed, if that matters.
I am trying to use the following code but its not updating anything and I am not getting any errors.
Please can someone show me what I am doing wrong. Thanks
Dim ws1112 As Worksheet, ws2221 As Worksheet
Set ws1112 = Sheets("Statistics")
Set ws2221 = Workbooks("\\UKSH000-File06\Purchasing\New_Supplier_Set_Ups_&_Audits\Workbook 2.xls").Sheets("Dashboard")
ws2221.Range("C7").Value = ws2221.Range("C7").Value + 1