0

I'm trying to print out a certain row based on a column that can be anything, and I was trying to use something like this:

'Gets me the Title(Top of Column) of whatever cell was changed
    If Worksheets("Testing Sheet").Range("A2").Value = "" Then

        Worksheets("Testing Sheet").Range("A2").Value = Range(Target.Column & ("7")).Value
    Else

        Worksheets("Testing Sheet").Range("A1").End(xlDown).Offset(1, 0).Value =  Range(Target.Column & ("7")).Value
    End If

I thought using something similar to this would work as you see above in my code:

Range("H" & Target.Row)

which seems to work for that case, but when I try to do a specific row I get the error "Method Range of Object_Worksheet failed". Hopefully it's a very easy fix that I just don't know about

1 Answer 1

1

Range cannot be used with absolute row and column numbers use Cells(Row,Column) instead

Cells("7", Target.Column)

To get the Address and Value of the changed cell, use Target.Address and Target.Value respectively

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, I didn't realize it was such a simple question. I always try to give as much detail as possible, but thanks for the advice. Definitely should have been simpler. Thanks for the help though. It worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.