Hello
i`m trying to find the column number in sheets "STATESTIK" to use as a variable
the problem is variable B
the value in "RESULTAT" "B2" is today date
the dates 01.01.2010, 01.02.2010, 01.03..... is in sheets "STATESTIK2 row "5"
at the først day in a month i want to copy the value in sheets "RÅDATA" "D2" to "STATESTIK" (A, B)
if i define the variable B = f.ex 5 it works
how can tell vba to retun the column number of f.ex 01.01.2010
a = Application.Match(Sheets("RÅDATA").Range("H2"), Sheets("STATESTIK").Range("A1:A54"), 0)
B = Application.Index(Sheets("RESULTAT").Range("B2"), Sheets("STATESTIK").Rows("1:30"), 0)
Sheets("RÅDATA").Range("D2").Copy
Sheets("STATESTIK").Cells(a, B).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub
i`m trying to find the column number in sheets "STATESTIK" to use as a variable
the problem is variable B
the value in "RESULTAT" "B2" is today date
the dates 01.01.2010, 01.02.2010, 01.03..... is in sheets "STATESTIK2 row "5"
at the først day in a month i want to copy the value in sheets "RÅDATA" "D2" to "STATESTIK" (A, B)
if i define the variable B = f.ex 5 it works
how can tell vba to retun the column number of f.ex 01.01.2010
a = Application.Match(Sheets("RÅDATA").Range("H2"), Sheets("STATESTIK").Range("A1:A54"), 0)
B = Application.Index(Sheets("RESULTAT").Range("B2"), Sheets("STATESTIK").Rows("1:30"), 0)
Sheets("RÅDATA").Range("D2").Copy
Sheets("STATESTIK").Cells(a, B).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub