Share via

VBA runtime error 1004 when x1

Kink, Tobias 1 Reputation point
2021-08-20T10:07:20.67+00:00

Hey guys,

I have an important question, because when I type in something like

last = ActiveSheet.Cells(Rows.Count, 9).End(x1Up).Row to select everything until the last cell, then I get the runtime error 1004, even though I did everything exactly the same like the Yotuuber did in his video that I was watching.

But also commands like
.Borders(xlInsideHorizontal).LineStyle = x1Dash
.Borders(xlInsideVertical).LineStyle = x1Continuous
.Borders(xlEdgeBottom).LineStyle = x1Double

just don´t work. Nothing happens.

Or even the follwing command also brings me a runtime error 1004.

With Range("E1:F3")
.Merge
.Value = "Neuer Text"
.HorizontalAlignment = x1Center
.VerticalAlignment = x1Center

I have the suspicion that i has to do with those x1(..) things, does someone maybe have the same problem or knows a solution? Maybe a setting which disables those commands?

You would help me so much!

Toby

Developer technologies | Visual Basic for Applications
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.