Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Excel - Stock Macro Help

Let me know if this helps.

Sub changeproductcodes()
For i = Cells(Rows.Count, "d").End(xlUp).Row To 14 Step -1
Rows(i - 1).Insert
c = Cells(i, "d")
p1 = InStr(c, " ")
p2 = InStr(p1, c, "/")
p3 = InStr(p2, c, " ")
s1 = Left(c, p1 - 1) & "-1" & Mid(c, p1, p2 - p1) & Right(c, Len(c) - p3 +
1)
s2 = Left(c, p1 - 1) & "-2 " & Mid(c, p2 + 1, p3 - p2) & Right(c, Len(c) -
p3 + 1)
Cells(i, "d").Value = s1
Cells(i + 1, "d").Value = s2
Next i
End Sub

--
Don Guillett
SalesAid Software

"Materialised" wrote in message
...
Hi All,

I have a very large sheet, which covers a suppliers range of products.
The format is as follows:
ALDL/A/R Glass/Nkl 75 25.51 51.02 £51.02

Where the first column is the product code, the second relates to the
colours of the product available.
What I need to do, is loop through the sheet, and create individual rows
for each available product.
So instead of the above, I would have something like:
ALDL/A/R-1 Glass 75 25.51 51.02 £51.02
ALDL/A/R-2 Nkl 75 25.51 51.02 £51.02
The product code has now changes, to reflect an individual product.
I am very new to excel programming and have only covered the simplest of
things, but the way I see it working is the user would specify a column
which in this would be B to indicated which column the various colour
codes are in. Then they would have to specify a seperator character
which in this case would be "/" (these are not always the same) then the
macro would loop through the sheet, making the alerations.
Could anyone give me a few pointers on how I could do this please, as I
said before, I am not to good with writing macros.

Thanks

(Sorry for the repost, I didnt want any title confusion with a previous
post)


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
Stock control formulas, counting and reporting remaining stock santaviga Excel Programming 2 October 23rd 06 01:34 PM
Web Query With Multiple Stock Symbols & Stock Scouter Manfred Excel Worksheet Functions 0 March 1st 06 09:13 PM
How can I use Dutch (NL) stock MSN MoneyCentral Stock in Excel Jeroen Excel Worksheet Functions 0 February 16th 06 03:14 PM
Office 2003 Stock Action Add-In - Stock Handling Capacity/Numbers nick Excel Worksheet Functions 0 January 2nd 06 09:22 PM
Excel macro to get stock quotes off the www Bob Benjamin Excel Programming 1 November 3rd 03 03:39 AM


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