Cresting A Simple Sort Using Control Objects And Various Macros
Jan 28, 2010
I was wondering how it would be possible to create a sort button to perform various sorts on a set of data. Essentially I want to mirror the data sort function in excel but strip it down and have it on the worksheet to make it obvious to people who aren't very excel savvy.
I have 5 columns I want to be able to sort by and I want the option to sort ascending or descending.
I've recorded macros for each type of sorting and now just need to know how to get them to work with the control objects.
I have a combo box with a list of the columns and two radio buttons: one marked 'ascending' the other 'descending'. I also have a button called 'sort' to perform the sort after criteria is selected.
What I need to do now is it to get each macro to run when a certain combination of combo box selection and radio button selection is made.
eg When 'Date' is selected in the combo box and 'ascending' is selected on the radio button it will run the 'SortDateAscending' Macro I have recorded and so on.
View 9 Replies
ADVERTISEMENT
Apr 23, 2007
Here is the Sheet so far: ...
View 9 Replies
View Related
Dec 27, 2013
So I'm creating a grid worksheet for engineering calculations and I have a couple questions about the best way to do it. I've been messing with excel for my calcs for about a decade now, and I every once in a while I try and improve them.
First: I will have several input areas that will either be colored text or shaded background (either works for me). I don't want these 'input required' objects to print as color, just black. But I want my logo at the sheet top to print as color. I've only found ways to not print any color. Can I print the logo as color and the 'input required' stuff as black?
Second: When I do calcs by hand, I write them out on 10x10 grid paper. Each 10x10 grid is one inch. In the past I've created this grid out of the cells, which works. I frequently need to change formulas around though, and each time I do this, I end up needing to mess with the grid cells also. Is there a way to create the grid and have it in the background so it doesn't need to be adjusted each time I change formulas? I wan't the grids to print, and also want to see them on the screen, as I sometimes draw simple objects along with the formulas.
View 9 Replies
View Related
Jun 4, 2008
I am designing (badly!) an excel file that is intended to be as user friendly as possible. I would like to add in a navigation feature using a list box or other appropriate control form that will take the user to the correct tab in the workbook depending on which item they choose from the list.
My aim is too hide all the tabs at the bottom whilst not crowding my page with multiple command buttons, and still be able to navigate easily through the workbook.
View 12 Replies
View Related
Aug 7, 2006
I am an average user of excel and i am wanting some help with macros. I can record macros, that i do understand. Its the part where you can assign the macros to the Checkbox i have created.
The effect i am trying to create is that when the checkbox has a tick in it, certain properties happen to a cell. But when the checkbox has no tick in it something else happens to the cell. I have recorded 2 macros for what i want to happen its just getting it associated with the true/false of the checkbox.
I have no Visual Basic Experience and i have tried reading other posts, but the code just goes right over my head at the moment. Thanks in advance for anyhelp. I can attach the spreadsheet etc...
View 9 Replies
View Related
Nov 7, 2012
"How to create a 'main' macro to control other macros within a workbook". I have my individual macros created. There's one macro for each sheet that searches online data and returns the information. I have one of these per sheet (a total of 20 sheets) since I couldn't find a way to have all 20 macros be on one sheet and still work. My trouble is that whenever I'm on my 'main' sheet and try to run the macro which applies to a 'secondary' sheet, I get an error. I have to select the sheet first, then run the macro and it works. Below is the macro on each sheet.
VB:
Sub Holding1()
Dim DataSheet As Worksheet
Dim EndDate As Date [code].....
View 8 Replies
View Related
Feb 8, 2009
I was able to create a macro to sort two columns in ascending order and then calculating their difference in the 3rd column via a macro, which work only when all the numbers were matching. if there's a mismatch then i had to separate them manually.
I am pretty much new to Macros and was thinking how do i make a macro which would compare the two columns and move the ones to the bottom which do not match?
View 6 Replies
View Related
Mar 1, 2008
Saw quite a few threads on auto sorting but nothing that solves my problem: Sheet 1 has two columns, column A has names and column B has numbers. These numbers are manually entered, and there are duplicate values.
Sheet 2 has to present the same names and numbers in ascending sort order. I cannot use macros due to security restrictions. I can accomplish it using a combination of functions LARGE and INDEX, if the values are not duplicated. But that technique fails when there are duplicate values.
In other words, Sheet 1 has:
NAME VALUE
Bob 5
Joe 2
John 5
Sue 3
and Sheet 2 should auto sort these values and give us:
NAME VALUE
Joe 2
Sue 3
John 5
Bob 5
View 3 Replies
View Related
Mar 4, 2014
Is there any way in VBA to refer to a control in its own event procedure without referring to it by name/hard-coding?
It might be clearer to explain by a dummy code example:
[Code] ......
I'm seeking what I would need to replace Line1 with.
View 11 Replies
View Related
Jan 9, 2008
Within the ComboBox properties, is there anyway to control after "enter" his hit, you move to the right instead of down (similar to the edit under Tools/Options)?
View 9 Replies
View Related
Jan 12, 2007
I have created a userform within VBA which has a TreeView Control and a Spreadsheet control on it.
I have populated the TreeView control with data and what I want to be able to do is to drag the nodes off the TreeView control to the spreadsheet control.
I can drag onto a normal worksheet but not onto the spreadsheet control (the no drop mouse pointer keeps showing).
View 4 Replies
View Related
Oct 4, 2007
How do I determine which control the user is currently modifying on a multipage form (either changing, enterying or exiting the specific control). when I use "userform1.activecontrol" i get "multipage1" as the control name but I need the actual control on the specific active multipage. (also the .TABINDEX is for the multipage regardless of the on-page control) I use a generic data-field change SUBroutine so need the control name (and the TABINDEX) to provide my SELECT CASE. (so every fieldname_CHANGE calls the same SUB [with no parameters])
View 3 Replies
View Related
Aug 26, 2009
I have an Excel 2003 program that contains macros. One of the macros hides certain command bars and disables the worksheet menu bar. On close the opposite is true. The problem is, if a user uses the disable macros when opening then the worksheet menu bar and other command bars are still available. I would like to hide all of the data sheets and display another sheet that would normally be hidden displaying a message that the macros have to be enabled for the program to work correctly if disable macros is chosen. When the enable macros are used I would like the Error page to be hidden.
View 6 Replies
View Related
Jul 28, 2008
I have a user that keeps a maintenance log in an Excel worksheet and sends an updated copy once a week to a board member. Two weeks ago, the board member started complaining that he was prompted to enable/disable macros on opening and became worried when my user stated that no macros were used in the book. He is now concerned that we have sent him a virus.
I know the file is clean because I've scanned it, and when I look at the file in VB, there are no modules or classes present just the Sheets 1-3 and the ThisWorkbook file. None of these objects have any code in them. My user does have some macros in PERSONAL.XLS but they are not used in the workbook in question.
No one else gets the prompt for enabling/disabling macros. Even if I set my security to prompt for any macros, I get no message. I'm convinced that there must be some setting in his Excel that is causing this individual to get this message. Is there anything else other than a macro that would cause this?
View 9 Replies
View Related
Jul 15, 2008
I want to use VBA to update a drawing object's color, such as a circle.
For example, pretend I am counting sheep and I need to know when I have reached the maximum count by the visual aide of a stoplight. The script in my head reads: If the max. count of the sheep is less than 5, then the stoplight is green. If the max. count of the sheep is equal to 5, then the stoplight is yellow. If the max. count of the sheep is greater than 5, then the stoplight is red.
Is there a way to do such a thing on excel and with VBA?
View 9 Replies
View Related
Jun 29, 2006
I created four Ranges called "Range1", "Range2", "Range3" and "Range4", and wrote short program, that fills them:
Dim i As Integer
For i = 1 To 4
Range("Range" & i).value = 1
Next i
Is it possible to do similiar thing with for example ComboBox?
Let's say that i have comboBoxes named "cb1", "cb2", "cb3" and "cb4" and want to disable them.
View 9 Replies
View Related
Jan 26, 2007
I ran into some difficulties by calling an object's function from a collection.
'BondIndex Class Module
Option Explicit
Private m_BondReturn As Collection
Public Sub Initialize()
Set m_BondReturn = New Collection
End Sub
Public Sub Load(BondPoints As Integer)
Dim i As Integer
Initialize
'Load Parameters of Bond
End Sub
Property Get BondReturn() As Collection
Set BondReturn = m_BondReturn
End Property................................
View 2 Replies
View Related
Mar 22, 2007
If I hadn't read it on here, how would I have know that they existed? They are not mentioned in the standard Excel help files (not that I could see anyway).
What other "objects" are available? I had a look through the references in the VBE and there are literally hundreds on items which all look pretty "juicy". Does that mean there are a whole host of other objects that I could use in my Excel spreadsheets to either make them simplier or more powerful?
If so, where does one find any reference info on them?
View 3 Replies
View Related
Dec 21, 2007
Why should I set objects to nothing (ie clear them) just before ending a sub routine? Doesn't excel dump the variables after the sub is finished running?
Example:
Dim ws As worksheet
Then at the end...
Set ws = Nothing
View 3 Replies
View Related
Dec 31, 2009
In the attached sample workbook, (Excel 2007 format), there are hundreds, maybe thousands, of drawing objects and rectangles. They are mostly located near the top of column AC. You can't see any of them, because they are empty, or formatted to have no line and no fill, ubt if you move the cursor around in that area, it will eventually give you the option to "select" one of the objects. They appear to be stacked on top of each other.
This bloats the worksheet terribly. I have managed to shave the size of the attached sample down to 100K, bu deleting about 200 of the objects, but if I save this balnk file as an Excel 2003 file, it is 1.3 Mb.
I have discovered how to show what objects are on the worksheet, by selecting "Find and Select" and choosing to show the "Selection Pane". This pane shows hundreds of blank objects in the sheet. When this pane is open, however, if I try to select and delete an object, Excel locks up on me.
View 5 Replies
View Related
Feb 5, 2013
I'm not sure why they decided to export data this way but...I have a report that has pictures/objects that need to be in a cell so I can manipulate the data. I'm not really sure how to do this- and the only thread that related to this was over my head. This is not the original export- I've already done some sorting so the objects are all over the place- but basically if the object is C (picture 23) then I want that picture to say C in a cell somewhere. or if the picture is the dollar sign (picture 27) then I want a cell to say $. I don't know if I'm even explaining this right. Here is my workbook.
View 6 Replies
View Related
Jan 23, 2014
Is it possible to change colour of an object (Fill) say fill circle Red when A1="1" and Green when A1="0"
View 12 Replies
View Related
Jan 24, 2008
I manually Copied and Pasted contains in TXT File.
The TXT file is as below.
It has only 1 Column
7AB/9AB
8AB/10AB
7CA/10CA
7BB/10BB
7CB/10CB
7AA/9AA
What I want is to run some VB Script so that anything after / is ignored
and the Output shold be reformatted as below
7A1
8A1
7C0
7B1
7C1
7A0
The Above O/p is anything aftyer / is ignore and the last character of the 1st field is A is replace with 0 and B is replace with 1.
View 13 Replies
View Related
Dec 29, 2008
Hi all, starting this as a new problem because it's so far different from what I was originally talking about; but this does relate in part to my previous thread.
Anyway. I'm trying to set an array to set Range objects so that I can define each one as a seperate With block. Here's what I "know" when starting out.
I developed the following. I keep thinking it should be multidimensional but my sleep deprived brain came up with this instead. The problem is, it's throwing a 1004 Method "Range of object '_Worksheet'" failed at the With statement.
View 6 Replies
View Related
Jan 10, 2012
I have a Master sheet linked with another worksheets with formula.
Now I want to insert 1 column in between , and when trying to insert the column in it a message sowing that " Cannot Shift Objects of Sheet"
Why this error shwoing and how can i insert any column in it.
View 7 Replies
View Related
Jul 24, 2007
I have a range of cells I want to copy which has some textboxes and check boxes in it. When I do a copy/insert cells in vba it only copies the cells and their values but not any of the boxes.
.Range(.Cells(Origin.Row + 1, Origin.Column), .Cells(Origin.Row + 12, Origin.Column + 10)).EntireRow.Copy
.Range(.Cells(Ind.Row, 3), .Cells(Ind.Row, 3)).EntireRow.Insert Shift:=xlDown
View 9 Replies
View Related
Aug 9, 2007
If cell.value = {userArray} and cell.offset(0, 2).value = {taskArray}
Then cell.offset(0, 2).interior.colorindex = 3
I have three different {userArray}s and {taskArray}s and there will essentially be different code for each of the arrays and that's fine....
View 9 Replies
View Related
Aug 24, 2007
I'm trying to remove gif, jpg, and xls objects from a specific range and I can't seem to figure out how to do it. I can remove all objects from the sheet or only the gif and jpg files from a range. Here is the code I've been playing with:
Sub Clear_Sigs()
Dim Sh As Shape
With Worksheets("Sheet1")
For Each Sh In .Shapes
If Not Application.Intersect(Sh.TopLeftCell, .Range("A26:E32")) Is Nothing Then
If Sh.Type = msoPicture Then Sh.Delete
End If
Next Sh
End With
End Sub
I know this code says to delete only pictures and I've tried tweeking it to do all objects but it doesn't work for just the range I want. Any help is appreciated.
Thanks,
Amy
View 9 Replies
View Related
Sep 28, 2007
I want on my chart is an object (Arrow in this case), that is conditional formatted on data between 2 periods.
The first bar of 20 represents a top 20 list with most common failures.
I would like to have an arrow that indicates that if the last period, the amount of failures has gone up, down or is equal to the period before that.
So period 1, article 111 had 10 failures, period 2 article 111 had 20 failures, hence there should be an arrow pointing up related to that bar.
View 9 Replies
View Related
Jul 11, 2008
I have a code which i use to grab the highest price and the lowest price from various sheets in column D.
There are 19 sheets altogether and the code basically looks at the relevant sheet based on the value in another cell.
Example - if you type value "EUR/USD" then the highest price and the lowest price are taken from the sheet named "EURUSD".
Now - HOW can i HIDE all those 19 sheets without getting the visible object error?
View 9 Replies
View Related