Have code, need to travel

J

jhonnyc377

Hi there,

How can I take this code, which does exactly what I'd like, and create a
custom toolbar in excel? The entire package needs to be able to be
transparently installed and used on end-users' machines without them seeing
anything other than the custom menu or button. Is there a way to do all
this? Any coding help would be appreciated as I am a new developer in
general. It'd be spectacular to be able to select which cells are compared
as well, but I understand I'm asking for a lot to begin with. Any help would
be fantastic. The code I'm working with is as follows:

Sub stance()
Dim myrange, copyrange As Range
Lastrow = Cells(Cells.Rows.Count, "B").End(xlUp).Row
Set myrange = Range("B1:B" & Lastrow)
For Each c In myrange
If c.Value = c.Offset(, 1).Value Then
If copyrange Is Nothing Then
Set copyrange = c.EntireRow
Else
Set copyrange = Union(copyrange, c.EntireRow)
End If
End If
Next
If Not copyrange Is Nothing Then
'copyrange.EntireRow.Hidden = True
copyrange.Delete
End If
End Sub

--Any compiling, inserting and editing instructions would be helpful, this
is a brand new world for me. Thanks.
 
D

Dave Peterson

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

And if you use xl2007:

If you want to learn about modifying the ribbon, you can start at Ron de Bruin's
site:
http://www.rondebruin.nl/ribbon.htm
http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an
addin)
or
http://www.rondebruin.nl/2007addin.htm

In xl2007, those toolbars and menu modifications will show up under the addins.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top