take range for a formula from another file
Hello,
I'm trying to include a range from another file in a formula contained in my macro as below:
'----------------------------------
' Set formula to column "Reason Code 2"
'----------------------------------
LastRow = Range("A2").End(xlDown).Row
Range("K2").Select
ActiveCell.FormulaR1C1 = "=IF(COUNTIF('\\Ukchsbmsfsp002.one.ads.bms.com\shared02\European Capability Centre\P2P\Reports\Daily target\MACRO\[skratky.xlsx]Sheet1'!A$1:A$23,RC[-2]),RC[-2],""OTHER"")"
Range("K2:K" & LastRow).FillDown
It seems it's not working because the file "skratky.xlsx" is closed because at the end of the macro as soon as I open that file the fileds start to populate. I don't understand why it's not working because I'm using the same principle on other parts of the macro and the link to the other file is working.
Can you help me to understand it?
I attached the macro..
Thank you in advance for any help
Attachment | Size |
---|---|
makro new_updated (2).xlsm | 37.57 KB |
Recent comments
5 years 34 weeks ago
6 years 20 weeks ago
6 years 32 weeks ago
6 years 35 weeks ago
6 years 36 weeks ago
6 years 42 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago