Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default button awareness. i dont know if it can be done.


well....its a spreadsheet that has my products on it....and we offer
different colors for each product.....so instead of have a thousand
lines of products to choose from....we just have one that you can
specify color.....the button next to the row adds a second line of the
same product on the next row down...so they can have 2 or more colors
on the same item......

so i just want the button to duplicate the row on the next row down.
and im trying to get it so i dont have to have 250+ macro's with only a
model number in the code differing them.....i just want one macro that
can tell what button activated it and duplicate just that one item.
hope that helps....

heres my code so far.....but its the code for only one product of 250+

sub add_line_item()
application.screenupdating = false
dim foundcell as range

with activesheet.range(\"a:a\")
set foundcell = .find(what:=\"ga1078\", _
after:=.cells(.cells.count), _
lookin:=xlformulas, lookat:=xlpart, _
searchorder:=xlbyrows, searchdirection:=xlnext, _
matchcase:=false)
end with

if foundcell is nothing then
msgbox \"can not add more.\"
else
foundcell.select
end if

activecell.offset(1, -activecell.column + 1).select
activecell.entirerow.select
selection.insert shift:=xldown
foundcell.select
selection.resize(1, 12).select
selection.copy
foundcell.select
activecell.offset(1, -activecell.column + 1).select
selection.resize(1, 12).select
activesheet.paste
application.cutcopymode = false
foundcell.select
activecell.offset(1, -activecell.column + 1).select
selection.resize(1, 12).select
selection.borders(xldiagonaldown).linestyle = xlnone
selection.borders(xldiagonalup).linestyle = xlnone
with selection.borders(xledgeleft)
linestyle = xldashdot
weight = xlthin
colorindex = xlautomatic
end with
with selection.borders(xledgetop)
linestyle = xldashdot
weight = xlthin
colorindex = xlautomatic
end with
with selection.borders(xledgebottom)
linestyle = xldashdot
weight = xlthin
colorindex = xlautomatic
end with
with selection.borders(xledgeright)
linestyle = xldashdot
weight = xlthin
colorindex = xlautomatic
end with
foundcell.select
activecell.offset(1, -activecell.column + 1).select
selection.interior.colorindex = 37
activecell.offset(0, 8).select

application.screenupdating = true
end sub


--
cdde
------------------------------------------------------------------------
cdde's Profile: http://www.excelforum.com/member.php...o&userid=15532
View this thread: http://www.excelforum.com/showthread...hreadid=271393

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
Dont know if this is possible to do Jahcureus Excel Discussion (Misc queries) 0 February 3rd 06 11:47 AM
I know what I need but dont know how to do it solar_eclipse2 Excel Worksheet Functions 5 June 6th 05 01:44 AM
button awareness. i dont know if it can be done. cdde[_2_] Excel Programming 3 October 22nd 04 05:07 AM
Imitating Pivot table's context awareness R Avery Excel Programming 3 September 17th 04 05:19 PM
Dont know how? Krefty[_3_] Excel Programming 1 December 15th 03 10:43 AM


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