Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Yet Another Macro Question

As so often happens, my manager has now decided he would like to do it
another way. (Going Back to my BMX example)

Colour Codes ProdID Desc Price
2374 BMX Bicycle £99.99

A new row has been inserted, where the user will type the various colour
codes into. So for example:

Colour Codes ProdID Desc Price
W,R,B 2374 BMX Bicycle £99.99

The user would then select this row, and run a macro, and would have:
Colour Codes ProdID Desc Price
W,R,B 2374/W BMX Bicycle £99.99
W,R,B 2374/R BMX Bicycle £99.99
W,R,B 2374/B BMX Bicycle £99.99

Anyone have any ideas?
To be totally honest, I am no windows programmer, Im a UNIX admin, and
its been over 10 years since I even made a ripple in the water with any
windows programming. So any advise or pointers you could give me would
great.

Thanks
Mick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Yet Another Macro Question

Mick,

Assumimg the colour codes are in column A:

Sub TryNow()
Dim myCell As Range
Dim myR As Range
Dim myCodes As Variant
Dim i As Integer

Set myR = Selection.Cells(1).EntireRow
Set myCell = myR.Cells(1, 1)

myCodes = Split(myCell.Value, ",")

If LBound(myCodes) < UBound(myCodes) Then
myR.Copy
myR.Resize(UBound(myCodes) - LBound(myCodes)).Offset(1).Insert

For i = LBound(myCodes) To UBound(myCodes)
myCell(i + 1, 2).Value = myCell(i + 1, 2).Value & "/" & myCodes(i)
Next i
End If

End Sub

HTH,
Bernie
MS Excel MVP


"Materialised" wrote in message
...
As so often happens, my manager has now decided he would like to do it another way. (Going Back to
my BMX example)

Colour Codes ProdID Desc Price
2374 BMX Bicycle £99.99

A new row has been inserted, where the user will type the various colour codes into. So for
example:

Colour Codes ProdID Desc Price
W,R,B 2374 BMX Bicycle £99.99

The user would then select this row, and run a macro, and would have:
Colour Codes ProdID Desc Price
W,R,B 2374/W BMX Bicycle £99.99
W,R,B 2374/R BMX Bicycle £99.99
W,R,B 2374/B BMX Bicycle £99.99

Anyone have any ideas?
To be totally honest, I am no windows programmer, Im a UNIX admin, and its been over 10 years
since I even made a ripple in the water with any windows programming. So any advise or pointers
you could give me would great.

Thanks
Mick



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
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Macro Question carl Excel Worksheet Functions 2 May 15th 07 07:23 PM
Macro Question ALoecher New Users to Excel 3 March 9th 06 10:12 PM
one last macro question Michael A Excel Programming 3 March 7th 05 03:55 AM
macro question Dean[_5_] Excel Programming 1 June 14th 04 05:32 PM


All times are GMT +1. The time now is 12:22 PM.

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

About Us

"It's about Microsoft Excel"