Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 445

How do I set a variable to ActiveCell.Row

$
0
0

I would like to be able to return the row number of the active cell then assign that value a variable. It is saying "Object not Defined" for ActiveCell.Row when I attempt to run the Macro. I would like to have cells copied to another sheet based on the value of the active row.

This is the erroneous code

Sub CopyPaste()Set CurrentRow = ActiveCell.RowSelect Case test_expressionCase CurrentRow = 2Sheets("Drop-In").Range("A2").EntireRow.Copy Sheets("CompletedV2").Range("A2")Case ElseMsgBox "This is a sample box"End SelectEnd Sub

Viewing all articles
Browse latest Browse all 445

Trending Articles