Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help in macros


Hi guys

-I like to compare to columns (A, S) ,
for exemple A2 with the hole of S depnds to rows numbers of S
-and if for exemple A2 = S10, then I like to put all the row (M10, N10,
O10, P 10, Q 10 and R10) in another coloumn X2

thanks alot for your advise
Cherrs


--
Freeman_100
------------------------------------------------------------------------
Freeman_100's Profile: http://www.excelforum.com/member.php...o&userid=33208
View this thread: http://www.excelforum.com/showthread...hreadid=530506

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Need help in macros


Dim rng as Range, i as long, res as Variant

set rng = Range(Cells(1,"S"),cells(rows.count,"S"))
i = 2
do while not isempty(cells(i,"A"))
res = application.Match(cells(i,"A"),rng,0)
if not iserror(res) then
cells(res,"X").Resize(1,6).Value = _
cells(i,"M").Resize(1,6)
end if
i = i + 1
Loop

--
Regards,
Tom Ogilvy

--
Regards,
Tom Ogilvy


"Freeman_100" wrote:


Hi guys

-I like to compare to columns (A, S) ,
for exemple A2 with the hole of S depnds to rows numbers of S
-and if for exemple A2 = S10, then I like to put all the row (M10, N10,
O10, P 10, Q 10 and R10) in another coloumn X2

thanks alot for your advise
Cherrs


--
Freeman_100
------------------------------------------------------------------------
Freeman_100's Profile: http://www.excelforum.com/member.php...o&userid=33208
View this thread: http://www.excelforum.com/showthread...hreadid=530506


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help in macros


Dear Tom
Thank you alot for your help, please help to set up this progarm.
Inever used marcos and I have already all the data over excel.

if you dont mind step by step, thanks again

Cherrs


Tom Ogilvy Wrote:
Dim rng as Range, i as long, res as Variant

set rng = Range(Cells(1,"S"),cells(rows.count,"S"))
i = 2
do while not isempty(cells(i,"A"))
res = application.Match(cells(i,"A"),rng,0)
if not iserror(res) then
cells(res,"X").Resize(1,6).Value = _
cells(i,"M").Resize(1,6)
end if
i = i + 1
Loop

--
Regards,
Tom Ogilvy

--
Regards,
Tom Ogilvy


"Freeman_100" wrote:


Hi guys

-I like to compare to columns (A, S) ,
for exemple A2 with the hole of S depnds to rows numbers of S
-and if for exemple A2 = S10, then I like to put all the row (M10,

N10,
O10, P 10, Q 10 and R10) in another coloumn X2

thanks alot for your advise
Cherrs


--
Freeman_100

------------------------------------------------------------------------
Freeman_100's Profile:

http://www.excelforum.com/member.php...o&userid=33208
View this thread:

http://www.excelforum.com/showthread...hreadid=530506




--
Freeman_100
------------------------------------------------------------------------
Freeman_100's Profile: http://www.excelforum.com/member.php...o&userid=33208
View this thread: http://www.excelforum.com/showthread...hreadid=530506

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need help in macros

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Tutorials:
http://www.mvps.org/dmcritchie/excel....htm#tutorials

--
Regards,
Tom Ogilvy

"Freeman_100"
wrote in message
...

Dear Tom
Thank you alot for your help, please help to set up this progarm.
Inever used marcos and I have already all the data over excel.

if you dont mind step by step, thanks again

Cherrs


Tom Ogilvy Wrote:
Dim rng as Range, i as long, res as Variant

set rng = Range(Cells(1,"S"),cells(rows.count,"S"))
i = 2
do while not isempty(cells(i,"A"))
res = application.Match(cells(i,"A"),rng,0)
if not iserror(res) then
cells(res,"X").Resize(1,6).Value = _
cells(i,"M").Resize(1,6)
end if
i = i + 1
Loop

--
Regards,
Tom Ogilvy

--
Regards,
Tom Ogilvy


"Freeman_100" wrote:


Hi guys

-I like to compare to columns (A, S) ,
for exemple A2 with the hole of S depnds to rows numbers of S
-and if for exemple A2 = S10, then I like to put all the row (M10,

N10,
O10, P 10, Q 10 and R10) in another coloumn X2

thanks alot for your advise
Cherrs


--
Freeman_100

------------------------------------------------------------------------
Freeman_100's Profile:

http://www.excelforum.com/member.php...o&userid=33208
View this thread:

http://www.excelforum.com/showthread...hreadid=530506




--
Freeman_100
------------------------------------------------------------------------
Freeman_100's Profile:

http://www.excelforum.com/member.php...o&userid=33208
View this thread: http://www.excelforum.com/showthread...hreadid=530506



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
weird saving of a document with macros resulting with macros being transfered to the copy alfonso gonzales Excel Programming 0 December 12th 04 09:19 PM
Macros inside macros, and pasting into macro code. pagelocator[_2_] Excel Programming 1 November 24th 04 09:11 AM
Open workbook-macros enabled, opening another with macros George J Excel Programming 5 September 17th 04 02:07 PM
Macros not appearing in the Tools Macro Macros list hglamy[_2_] Excel Programming 5 October 24th 03 09:10 AM
Suppress the Disable Macros / Enable Macros Dialog Shoji Karai Excel Programming 5 September 24th 03 03:10 AM


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