Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Use vba to fill in matrix in excel.

I have a matrix format in excel that i need to fill in with a formula.
I was wondering if there was any vba code that could help me with this.
Example,

Policy Number Name Date

429438
975288
759284

I am going to be using a lookup function to fill in name and date, I
was hoping to get code that evaluates the # of fields and rows first
then copies in the encompassing cells. Thanks for the help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Use vba to fill in matrix in excel.

set rng = Range(Cells(2,1),Cells(2,1).End(xldown))
rng.offset(0,1).Formula = "=Vlookup(A2,Sheet2!$A$1:$C4200,2,False))"
rng.offset(0,2).Formula = "=Vlookup(A2,Sheet2!$A$1:$C4200,3,False))"

--
Regards,
Tom Ogilvy



wrote in message
oups.com...
I have a matrix format in excel that i need to fill in with a formula.
I was wondering if there was any vba code that could help me with this.
Example,

Policy Number Name Date

429438
975288
759284

I am going to be using a lookup function to fill in name and date, I
was hoping to get code that evaluates the # of fields and rows first
then copies in the encompassing cells. Thanks for the help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Use vba to fill in matrix in excel.

Got an extra ")" in there and a 4 instead of a $

set rng = Range(Cells(2,1),Cells(2,1).End(xldown))
rng.offset(0,1).Formula = "=Vlookup(A2,Sheet2!$A$1:$C$200,2,False)"
rng.offset(0,2).Formula = "=Vlookup(A2,Sheet2!$A$1:$C$200,3,False)"

--
Regards,
Tom Ogivly

"Tom Ogilvy" wrote in message
...
set rng = Range(Cells(2,1),Cells(2,1).End(xldown))
rng.offset(0,1).Formula = "=Vlookup(A2,Sheet2!$A$1:$C4200,2,False))"
rng.offset(0,2).Formula = "=Vlookup(A2,Sheet2!$A$1:$C4200,3,False))"

--
Regards,
Tom Ogilvy



wrote in message
oups.com...
I have a matrix format in excel that i need to fill in with a formula.
I was wondering if there was any vba code that could help me with this.
Example,

Policy Number Name Date

429438
975288
759284

I am going to be using a lookup function to fill in name and date, I
was hoping to get code that evaluates the # of fields and rows first
then copies in the encompassing cells. Thanks for the help.





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
How can I transpose nXm matrix to mXn Matrix MIHir Excel Worksheet Functions 2 August 9th 08 11:44 AM
The fill feature in Excel that gives option to fill or copy KAHelman New Users to Excel 1 July 29th 05 07:47 PM
How to fill colour in Excel, it appers No fill in my computer? bede Excel Discussion (Misc queries) 1 June 11th 05 03:27 AM
excel matrix Moneywiz2004 Excel Worksheet Functions 3 November 16th 04 07:16 PM
If/Then Matrix? Can Excel do this? D[_6_] Excel Programming 2 August 2nd 04 07:54 AM


All times are GMT +1. The time now is 06:30 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"