Blade3
Blade3

Reputation: 4380

VBA Excel Range method

I need to move a row of data to another worksheet when a user chooses a value in a listbox. I am trying to use the following code to select the row on the new worksheet I want to move the data to:

'Move data to the "Red" worksheet
Sheets("Red").Range ("A11").Select

I am getting an "Object does not support this property or method" error.

What am I doing wrong?

Upvotes: 2

Views: 739

Answers (3)

iDevlop
iDevlop

Reputation: 25272

There should NOT be a space between "Range" and "(".

Upvotes: 4

Jerry
Jerry

Reputation: 11

  1. Is selecting allowed on your sheet? (= selection not prohibited by protection)
  2. I have noticed a space character between the word Range and ("A11"). This might have caused a syntax error.

Upvotes: 1

Stewbob
Stewbob

Reputation: 16899

Use the macro recorder and manually perform the operation you want. Then you can look at the code recorded by Excel and clean it up to suit your needs.

The macro recorder is the easiest way to figure out whatever convoluted syntax VBA wants you to use.

Upvotes: 0

Related Questions