PC Review


Reply
Thread Tools Rate Thread

create a macro with the match lookup_array is changing everyday

 
 
Asraf
Guest
Posts: n/a
 
      5th May 2010
Dear all,

I have a problem to create a macro bcos my data for lookup_array will be add
up everyday.


Sub Macro1()

ActiveCell.FormulaR1C1 = "=MATCH(RC[1],R1C[2]:R10C[2],0)"

End Sub

 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      5th May 2010
Try
ActiveCell.FormulaR1C1 = "=MATCH(RC[1],C[2],0)"

OR

Dim lngRow As Long
lngRow = Cells(Rows.Count, ActiveCell.Offset(, 2).Column).End(xlUp).Row
ActiveCell.FormulaR1C1 = "=MATCH(RC[1],R1C[2]:R" & lngRow & "C[2],0)"


--
Jacob (MVP - Excel)


"Asraf" wrote:

> Dear all,
>
> I have a problem to create a macro bcos my data for lookup_array will be add
> up everyday.
>
>
> Sub Macro1()
>
> ActiveCell.FormulaR1C1 = "=MATCH(RC[1],R1C[2]:R10C[2],0)"
>
> End Sub
>

 
Reply With Quote
 
OssieMac
Guest
Posts: n/a
 
      5th May 2010
When you record your macro, instead of selecting C1:C10, Click the column Id
at the top of the column to select the entire column for the Lookup_Array.

--
Regards,

OssieMac


"Asraf" wrote:

> Dear all,
>
> I have a problem to create a macro bcos my data for lookup_array will be add
> up everyday.
>
>
> Sub Macro1()
>
> ActiveCell.FormulaR1C1 = "=MATCH(RC[1],R1C[2]:R10C[2],0)"
>
> End Sub
>

 
Reply With Quote
 
ozgrid.com
Guest
Posts: n/a
 
      5th May 2010
Use a Dynamic Named Range
http://www.ozgrid.com/Excel/DynamicRanges.htm


--
Regards
Dave Hawley
www.ozgrid.com
"Asraf" <(E-Mail Removed)> wrote in message
news:233C7671-1C48-4745-8553-(E-Mail Removed)...
> Dear all,
>
> I have a problem to create a macro bcos my data for lookup_array will be
> add
> up everyday.
>
>
> Sub Macro1()
>
> ActiveCell.FormulaR1C1 = "=MATCH(RC[1],R1C[2]:R10C[2],0)"
>
> End Sub
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Macro to create Index/Match OssieMac Microsoft Excel Programming 2 18th Feb 2009 01:51 AM
Re: Macro to create Index/Match Dave Peterson Microsoft Excel Programming 0 1st Feb 2009 01:34 PM
MATCH function, with variable lookup_array St03mp Microsoft Excel Programming 12 18th Apr 2008 01:50 PM
Match with Complex Lookup_array karlsven Microsoft Excel Worksheet Functions 2 20th Dec 2007 08:18 AM
Re: Macro to run everyday??? Don Guillett Microsoft Excel Programming 1 17th Jan 2007 10:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:29 AM.