Macro runs fine on my PC, however when running on an external PC, I receive the error '#NAME?' in all cells

j4ttlife

New Member
Joined
Feb 2, 2022
Messages
30
Platform
  1. Windows
  2. MacOS
Hi,

In my macro I added a CONCAT formula where cells in column A merge the contents of columns AG, W, and BT.

It runs fine on my PC with the CONCAT in column A showing the combined data, however when running on another PC I am met with the error '#NAME?'.

My code is as below:

VBA Code:
Dim LastRow1 As Long

Dim formul3 As String

formul3 = "=CONCAT(AG1,"" "",W1,"" "",BT1)"

Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row) = [formul3]

LastRow1 = Range("B" & Rows.Count).End(xlUp).Row

Range(Range("A1"), Range("A" & LastRow1)).FillDown

Is anyone able to identify what part of my code needs to be changed to enable the macro to run across all PCs? Thanks.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
How about
VBA Code:
formul3 = "=AG1&"" ""&W1&"" ""&BT1"
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,840
Members
449,471
Latest member
lachbee

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