ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Have code, need to travel (https://www.excelbanter.com/excel-programming/409959-have-code-need-travel.html)

jhonnyc377

Have code, need to travel
 
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.

Dave Peterson

Have code, need to travel
 
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.

jhonnyc377 wrote:

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.


--

Dave Peterson


All times are GMT +1. The time now is 04:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com