0

I have set up an Excel Macro that rearranges an Excel sheet to only the information I need, and places this in an output sheet and then saves the document under a specific name. This works fine on my laptop, but when using this on another computer, I get runtime error 1004 on a specific line. I have made sure to enable macros on both systems and allow VBA.

Below is the VBA code that runs the error, this is the part of the code which selects a mobile number, and if no mobile number is provided it will then check for home number, and then work number, and paste this into the Output sheet:

ActiveCell.Formula2R1C1 = _
               "=IFS(AND(Input!RC[10]="""",Input!RC[8]=""""),Input!RC[9],Input!RC[10]="""",Input!RC[8],Input!RC[10]<>"""",Input!RC[10])"
    Next Row

I'd be grateful for any help!

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
  • Please read [mcve] and provide a full example that reproduces the issue. The code you show is very likely not the real issue. You might benefit from reading [How to avoid using Select in Excel VBA](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba). – Pᴇʜ Apr 12 '21 at 14:48
  • Does the failing version of Excel support the `IFS` function? – BigBen Apr 12 '21 at 14:51
  • Is the problem the computer or the spreadsheet on the computer? Maybe the two spreadsheets are not identical. – John Coleman Apr 12 '21 at 14:52
  • Check that the formula, when entered manually in `ActiveCell` on the dysfunctional computer, produces a non-error result. – Ron Rosenfeld Apr 13 '21 at 00:29
  • The spreadsheets are the same, originally emailed them over. But re-wrote them just incase something changed. Same with the code, re-wrote it again but still no luck. Could it be due to some kind of firewall or security on the other computer? – user15612555 Apr 15 '21 at 12:33

0 Answers0