MadMatLePsyke
New Member
- Joined
- Jan 3, 2023
- Messages
- 18
- Office Version
- 365
- Platform
- Windows
Good Morning All,
I have a small issue after running my VBA code. Instead of the correct results I have #Value!
My code is this one :
instead of a number I have #value, but if I'm putting the ref of cell ie : A4 instead of str1 on Excel I have the correct results
Can someone help me ?
HNY
I have a small issue after running my VBA code. Instead of the correct results I have #Value!
My code is this one :
VBA Code:
Sub DATAFAC()
Set Wb = ThisWorkbook
Set WsB = Sheets("BOARD")
Set WsFA = Sheets("FACTSET")
Dim R As Byte
Dim str1 As String
Dim str2 As String
Dim str3 As String
Dim str4 As String
Dim str5 As String
Dim str6 As String
Dim str7 As String
Dim str8 As String
WsFA.Select
Range("A:A").Select
Selection.Copy
Range("A:A").Select
Selection.PasteSpecial Paste:=xlValues
R = ActiveSheet.UsedRange.Rows.Count
str2 = "FE_ESTIMATE"
str3 = "SALES"
str4 = "MEAN"
str5 = Cells(4, 4)
str6 = "0"
str7 = "EUR"
For i = 5 To R + 2
str1 = Cells(i - 1, 1).Value
Cells(i, 4).Select
Selection.Formula = "=FDSB(" & str1 & ",""" & str2 & " (" & str3 & "," & str4 & ",ANN_ROLL," & str5 & "," & str6 & ",,,'CURRENCY=" & str7 & ",BKRF= 1957')"")"
i = i + 5
Next i
Can someone help me ?
HNY
Last edited by a moderator: