Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Newbie Question

Hello Everyone. I am a complete newbie to Macro's and would ask 2 things.

1.) Does anyone have some good links to Tutorials on Macros?

2.) I have an excel sheet that has a column of numbers and I would like to
have the sheet show me what row the numbers are in.

A small example:

ROW Col.A Col.B Col.C.
001 01 02 03
002 04 03 02
003 01 02 04
004 02 03 04
005 01 03 04
006 04 03 02

I would like a new sheet created or copied into a preset sheet so it would
look like:

Col.A Col.B Col.C Col.D Col.E Col.F
01 001 003 005
02 001 002 003 004 006
03 001 002 004 005 006
04 002 003 004 005 006

Thank you for any assistance.
David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Newbie Question

Hi,
Your question raises a lot of other questions. The numbers listed all have
leading zeros, which is not normally the case in Excel, so I guess the first
question is whether these are Text or numbers? Then the next question might
be are the only "numbers" 1-4 or can there be an unlimited number of numbers?

Thanks,

"David" wrote:

Hello Everyone. I am a complete newbie to Macro's and would ask 2 things.

1.) Does anyone have some good links to Tutorials on Macros?

2.) I have an excel sheet that has a column of numbers and I would like to
have the sheet show me what row the numbers are in.

A small example:

ROW Col.A Col.B Col.C.
001 01 02 03
002 04 03 02
003 01 02 04
004 02 03 04
005 01 03 04
006 04 03 02

I would like a new sheet created or copied into a preset sheet so it would
look like:

Col.A Col.B Col.C Col.D Col.E Col.F
01 001 003 005
02 001 002 003 004 006
03 001 002 004 005 006
04 002 003 004 005 006

Thank you for any assistance.
David

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Newbie Question

They are custom numbers that are formatted in the 00 format. I would say they
can be from number 1 - 99. I would not need it higher then that but I am sure
if it was able then going higher then 99 would be fine.

Thank you for any assistance in this.
David

"David" wrote:

Hi,
Your question raises a lot of other questions. The numbers listed all have
leading zeros, which is not normally the case in Excel, so I guess the first
question is whether these are Text or numbers? Then the next question might
be are the only "numbers" 1-4 or can there be an unlimited number of numbers?

Thanks,

"David" wrote:

Hello Everyone. I am a complete newbie to Macro's and would ask 2 things.

1.) Does anyone have some good links to Tutorials on Macros?

2.) I have an excel sheet that has a column of numbers and I would like to
have the sheet show me what row the numbers are in.

A small example:

ROW Col.A Col.B Col.C.
001 01 02 03
002 04 03 02
003 01 02 04
004 02 03 04
005 01 03 04
006 04 03 02

I would like a new sheet created or copied into a preset sheet so it would
look like:

Col.A Col.B Col.C Col.D Col.E Col.F
01 001 003 005
02 001 002 003 004 006
03 001 002 004 005 006
04 002 003 004 005 006

Thank you for any assistance.
David

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Newbie Question

Hi Again,
Will the numbers always be consecutive and with out gaps? What I mean is
that they will alwys be like 1,2,3,4 and not 1,3,4, no gaps?

Thanks,

"David" wrote:

They are custom numbers that are formatted in the 00 format. I would say they
can be from number 1 - 99. I would not need it higher then that but I am sure
if it was able then going higher then 99 would be fine.

Thank you for any assistance in this.
David

"David" wrote:

Hi,
Your question raises a lot of other questions. The numbers listed all have
leading zeros, which is not normally the case in Excel, so I guess the first
question is whether these are Text or numbers? Then the next question might
be are the only "numbers" 1-4 or can there be an unlimited number of numbers?

Thanks,

"David" wrote:

Hello Everyone. I am a complete newbie to Macro's and would ask 2 things.

1.) Does anyone have some good links to Tutorials on Macros?

2.) I have an excel sheet that has a column of numbers and I would like to
have the sheet show me what row the numbers are in.

A small example:

ROW Col.A Col.B Col.C.
001 01 02 03
002 04 03 02
003 01 02 04
004 02 03 04
005 01 03 04
006 04 03 02

I would like a new sheet created or copied into a preset sheet so it would
look like:

Col.A Col.B Col.C Col.D Col.E Col.F
01 001 003 005
02 001 002 003 004 006
03 001 002 004 005 006
04 002 003 004 005 006

Thank you for any assistance.
David

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Newbie Question

I can understand all the questions for clarification and I appreciate it. My
thoughts are that yes the numbers will be consecutive down the rows like:

1
2
3
4

The columns might have gaps going from 1, 3, 5, 12, 23, 45.. etc. like:
(where Col.B through Col.<whatever letter would be what rows the number 01,
02, 03, or 04, etc. originally were located.)

Col.A Col.B Col.C Col.D Col.E Col.F
01 001 003 005
02 001 002 003 004 006
03 001 002 004 005 006
04 002 003 004 005 006

Thank you
David



"David" wrote:

Hi Again,
Will the numbers always be consecutive and with out gaps? What I mean is
that they will alwys be like 1,2,3,4 and not 1,3,4, no gaps?

Thanks,

"David" wrote:

They are custom numbers that are formatted in the 00 format. I would say they
can be from number 1 - 99. I would not need it higher then that but I am sure
if it was able then going higher then 99 would be fine.

Thank you for any assistance in this.
David

"David" wrote:

Hi,
Your question raises a lot of other questions. The numbers listed all have
leading zeros, which is not normally the case in Excel, so I guess the first
question is whether these are Text or numbers? Then the next question might
be are the only "numbers" 1-4 or can there be an unlimited number of numbers?

Thanks,

"David" wrote:

Hello Everyone. I am a complete newbie to Macro's and would ask 2 things.

1.) Does anyone have some good links to Tutorials on Macros?

2.) I have an excel sheet that has a column of numbers and I would like to
have the sheet show me what row the numbers are in.

A small example:

ROW Col.A Col.B Col.C.
001 01 02 03
002 04 03 02
003 01 02 04
004 02 03 04
005 01 03 04
006 04 03 02

I would like a new sheet created or copied into a preset sheet so it would
look like:

Col.A Col.B Col.C Col.D Col.E Col.F
01 001 003 005
02 001 002 003 004 006
03 001 002 004 005 006
04 002 003 004 005 006

Thank you for any assistance.
David



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Newbie Question

Hi,
Try this. It assumes numbers in range 1- 99 and collates the rows
for each number on Sheet2. If a number is not found in the original range,
the corresponding row in Sheet2 is blank.


Sub FindRows()

Dim rng As Range, rngA As Range, c As Range
Dim ws1 As Worksheet, ws2 As Worksheet
Dim i As Integer, idx As Long

Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")

ws1.Select
' Change this range as required
Set rng = ws1.Range("A1:D" & Cells(Rows.Count, "A").End(xlUp).Row)

For i = 1 To 99 ' Set numbers 1 to 99 in col A of Sheet2
ws2.Cells(i, 1) = i
Next i

For Each c In rng ' Loop through each cell in selected range
idx = c.Value ' Row index in Sheet 2
With ws2
Set rngA = .Range("A" & Trim(Str(idx)) & ":IV" & Trim(Str(idx)))
' COUNTA is used to determine last used column for selected row IDX
.Cells(idx, Application.CountA(rngA) + 1) = c.Row ' Add to next column
End With
Next c

End Sub

HTH

"David" wrote:

Hello Everyone. I am a complete newbie to Macro's and would ask 2 things.

1.) Does anyone have some good links to Tutorials on Macros?

2.) I have an excel sheet that has a column of numbers and I would like to
have the sheet show me what row the numbers are in.

A small example:

ROW Col.A Col.B Col.C.
001 01 02 03
002 04 03 02
003 01 02 04
004 02 03 04
005 01 03 04
006 04 03 02

I would like a new sheet created or copied into a preset sheet so it would
look like:

Col.A Col.B Col.C Col.D Col.E Col.F
01 001 003 005
02 001 002 003 004 006
03 001 002 004 005 006
04 002 003 004 005 006

Thank you for any assistance.
David

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Newbie Question

That was exactly what I needed. Did the trick perfectly.
Thank you.

David

"Toppers" wrote:

Hi,
Try this. It assumes numbers in range 1- 99 and collates the rows
for each number on Sheet2. If a number is not found in the original range,
the corresponding row in Sheet2 is blank.


Sub FindRows()

Dim rng As Range, rngA As Range, c As Range
Dim ws1 As Worksheet, ws2 As Worksheet
Dim i As Integer, idx As Long

Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")

ws1.Select
' Change this range as required
Set rng = ws1.Range("A1:D" & Cells(Rows.Count, "A").End(xlUp).Row)

For i = 1 To 99 ' Set numbers 1 to 99 in col A of Sheet2
ws2.Cells(i, 1) = i
Next i

For Each c In rng ' Loop through each cell in selected range
idx = c.Value ' Row index in Sheet 2
With ws2
Set rngA = .Range("A" & Trim(Str(idx)) & ":IV" & Trim(Str(idx)))
' COUNTA is used to determine last used column for selected row IDX
.Cells(idx, Application.CountA(rngA) + 1) = c.Row ' Add to next column
End With
Next c

End Sub

HTH

"David" wrote:

Hello Everyone. I am a complete newbie to Macro's and would ask 2 things.

1.) Does anyone have some good links to Tutorials on Macros?

2.) I have an excel sheet that has a column of numbers and I would like to
have the sheet show me what row the numbers are in.

A small example:

ROW Col.A Col.B Col.C.
001 01 02 03
002 04 03 02
003 01 02 04
004 02 03 04
005 01 03 04
006 04 03 02

I would like a new sheet created or copied into a preset sheet so it would
look like:

Col.A Col.B Col.C Col.D Col.E Col.F
01 001 003 005
02 001 002 003 004 006
03 001 002 004 005 006
04 002 003 004 005 006

Thank you for any assistance.
David

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
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
Newbie question Vince Excel Discussion (Misc queries) 12 August 21st 06 06:22 PM
newbie question [email protected] Excel Worksheet Functions 5 July 12th 06 01:25 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
Newbie question Doh New Users to Excel 5 December 16th 04 09:31 PM


All times are GMT +1. The time now is 02:48 AM.

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"