Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Application.WorksheetFunction.Index syntax

Novice, self-teaching VB user here...please help!

I am trying to do a simple For/Next Loop with an Index
Statement. I want to insert a text string from a range
names "List" into a cell, move 5 cells to the right,
insert the next name, etc.

I keep getting "Compile Error: Expected =" on the Index
Statement. What am I leaving out??
Thanks,LJ
---------------------

Range("A1").Select
For x = 1 To 3
Application.WorksheetFunction.Index(Range("List"), x,1)
ActiveCell.Offset(0,5).Select
Next x
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Application.WorksheetFunction.Index syntax

ActiveCell = Application.WorksheetFunction.Index(Range("List"), x,1)

(although I would avoid all the selecting).

--

Vasant




"LJones" wrote in message
...
Novice, self-teaching VB user here...please help!

I am trying to do a simple For/Next Loop with an Index
Statement. I want to insert a text string from a range
names "List" into a cell, move 5 cells to the right,
insert the next name, etc.

I keep getting "Compile Error: Expected =" on the Index
Statement. What am I leaving out??
Thanks,LJ
---------------------

Range("A1").Select
For x = 1 To 3
Application.WorksheetFunction.Index(Range("List"), x,1)
ActiveCell.Offset(0,5).Select
Next x



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Application.WorksheetFunction.Index syntax



index is a function. thus is will produce a result.
you dont assign the produced result to a variable..
or a cell.. thus the error :)

change to Activecell.value =Application.Work...

and you s/b fine



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


LJones wrote :

Novice, self-teaching VB user here...please help!

I am trying to do a simple For/Next Loop with an Index
Statement. I want to insert a text string from a range
names "List" into a cell, move 5 cells to the right,
insert the next name, etc.

I keep getting "Compile Error: Expected =" on the Index
Statement. What am I leaving out??
Thanks,LJ
---------------------

Range("A1").Select
For x = 1 To 3
Application.WorksheetFunction.Index(Range("List"), x,1)
ActiveCell.Offset(0,5).Select
Next x


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default THANKS

Thanks! I feel kind of stupid for forgetting something
so simple.


-----Original Message-----
Novice, self-teaching VB user here...please help!

I am trying to do a simple For/Next Loop with an Index
Statement. I want to insert a text string from a range
names "List" into a cell, move 5 cells to the right,
insert the next name, etc.

I keep getting "Compile Error: Expected =" on the Index
Statement. What am I leaving out??
Thanks,LJ
---------------------

Range("A1").Select
For x = 1 To 3
Application.WorksheetFunction.Index(Range("List"), x,1)
ActiveCell.Offset(0,5).Select
Next x
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reuse Application.WorksheetFunction jlclyde Excel Discussion (Misc queries) 4 March 12th 09 08:32 PM
Need help with Application.WorksheetFunction Ayo Excel Discussion (Misc queries) 4 May 14th 08 11:13 PM
Syntax for WorksheetFunction Match Hardy[_3_] Excel Programming 1 June 4th 04 11:33 AM
Syntax for WorksheetFunction Mike Fogleman Excel Programming 3 March 1st 04 09:13 PM
Using Application.WorksheetFunction.Ln(...) in VBA doco Excel Programming 4 August 25th 03 01:08 PM


All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"