Private Sub UserForm_Initialize()
Dim a, v, x, ws As Worksheet
Set ws = Sheets("Scheduled Courses")
a = ws. Range("a2", ws.[a65536].End(xlUp)).Value
With CreateObject("scripting.dictionary")
For Each v In a
If Not IsEmpty(v) And Not .exists(v) Then
.Add v, Nothing
End If
Next
x = .keys
End With
With Me.ComboBox1
.Clear ' clear the listbox content
.List = x
.ListIndex = 0 ' select the first item
End With
End Sub
How are the brackets used in the 4th line? I have not seen this notation before. Is this some kind of a shorthand for a Range("A65536") reference?
I'm looking at some VBA code that I have to convert into another programming language and I'm having a little trouble reading it. Here's the line that's throwing me...
I am working with a income statement in excel, and I need to calculate the tax rate on Net Income. I have to calculate this with both positive and negative net income, and insert this into the cell below net income. I also have to account for different tax rates.
$0–$7,500 10.0% 7,500-30,650 15.0 30,650 –74,200 25.0 74,200–154,800 28.0 154,800–336,500 33.0 336,500 and up 35.0
I am preparing one macro and to make below macro more easier.
My Data is not constant. Everyday it get change.
In my data i am trying to delete all rows which begin with "MEANING".
I have prepared below macro but problem here is in range i am taking maximum rows i.e 65000 as i am not sure how many rows will be there in my data which begin with Meaning.
I just wanted to know what is the coding we use to go down untill data end if we are not sure about the range.
I have been thinking about this for a few days and have no idea where to start. The commission scheme pays like this:
upto $40,000 in sales pays 30% $40,001 to $80,000 pays 40% $80,001 + pays 50%
Also, the sales person will only earn commission once they have invoiced 1/3 of their basic salary. Example
$60,000 must invoice $20,000 per month, therefore commission is actually 30% of the remaining $20,000.
I want to create a spreadsheet that allows me to enter the basic salary for individual sales persons and their individual sales figures to calculate their gross commission and also their gross basic salary if I can.
i really frustrated to my excel file already . every time when i open it and it will appear a error box '' some text formatting may have changed in this file because the maximum number of font was exceeded'' .
I am trying to create a spreadsheet to determine hrs per time interval
i.e 06:00 - 14:00 14:00 - 22:00 22:00 - 06:00
So a start time of 06:00 and finish time of 14:00 would show 8hrs in first interval and 0 in the other 2 and a start time of 10:00 and a finish time of 18:00 would show 4hrs in first interval and 6 in second and 0 in last
I've currently got start time in A1 , finish time in B1 and want hours for interval 1 in D1 , interval 2 in E1 and interval 3 in F1.
I have this table which has employees names with basic pay and contribution.
I was tasked to create a excel sheet where in if the employees basic pay is input, the corresponding contribution for the employee will show depending on which salary bracket he/she is on.
I am not allowed to know what my workmates salaries are since im just an associate, so i just have to leave em blank and wait for my manager to input their salary.
See attached file for the workbook : PHEALTHWORKBOOK.xlsx‎
I'm trying to create a bracket for video game tournaments and I'm having trouble with some of the functionality I want it to have.
Right now, I have cells B7 and B9 that will pull player names from another check in sheet. I have another cell, D8, that I would like to have a drop down list in containing the contents of B7 and B9. Everything I see online says to use Data Validation, but apparently that tool can't make a list using cells that aren't next to each other, so that won't work. How else can I tell excel how to populate this list? It is vital that the cells be apart from each other because the visual formatting is necessary for displaying the bracket on a projector so that the players can see their match assignments.
In addition, I would like to have another drop down menu in another cell with a list of valid bracket sizes (4, 8, 16, 32, etc.), and have the cells of the sheet either be visible or invisible depending on how many max players can enter. In other words, if columns B, D, F, and H correspond to the number of rounds it will take to finish the tournament (3, 2, 1, and 0, respectively), I would like the sheet to display only the cells necessary for the tournament, pull player names into the left most cells needed from another worksheet used for sign ups, and auto populate all of the columns to the right of the column for first round with drop down lists for the players who could have won that match in the previous round.
I work for a company that exports data from a website into Excel.
So here's my problem:
The data is usually Part Numbers using numbers and letters. When a Part Number is, for example, 248E12 we have this reaccurring issue. Importing it into Excel automatically converts it to scientific notation (ie. 248E+12 or 2.48E+14 to be exact). "Format Cell" doesn't convert it back because it was auto-converted when "exported". I need a way of fixing this problem without going line by line and doing the math to convert it myself.
I don't have time for that. Some of my files have thousands of lines.
I'm trying to filter a long list to look for specific employee numbers. The employee numbers are so long that they have to be formatted as text or they are automatically formatted as scientific notation (they are 18 digits long). For some reason this is causing the filter not to work properly.
I have noticed in many of the Excel help files that the developers liked to use shortcut notation for Range reference in VBA.
For example, Range("A1:B10") would be [A1:B10].
I was doing a bit of testing with this, and was not able to make the shortcut notation work with a variable. Does the shortcut method have the capabilities to do the equivalent of Range("A1:B" & LR)?
If it does have that capability, is it just due to force of habit that we always use Range() to refer to ranges, or would there be a more in-depth reason.
I'm trying to select a range of cells using the R1C1 notation. But I'm making an error in the syntax. I know it's really simple, I just don't know what's wrong.
I have a bit of code that is grabbing only the first 9 positions of an alpha-numeric string. The problem I am running into is that when the alpha-numberic value contains an "E", the code turns it into an exponential number in error.
For example, I have the following in column G: 01877E107000. When I run the code, it turns into an alpha-numeric value. The result should be 01877E107 (in column K). I tried using the text function within the code.
I am trying to debug the above line of code (moNum is just a variable the tells me how many months to extend the range to the right inorder to get year to date sums).
I have gotten to the point that it will run error free if "Revenue" is the Active worksheet when I run the line, but if I am on any other sheet it throws an "Run=time '1004' Application-defined or object-defined error" error. And if I change the range from cell notation to Column-Row, the issue goes away as well.
I have a large file with account numbers in Number format. Before I can import the data into a database the account numbers need to be converted to Text. I use Text(A1,0) to do this in a large file. The data then gets copied into a new Import file. When the data gets copied the account cell reverts back to scientific notation for the long account strings. The import file account column is formated for Text. The only fix is to then double click on each account that is in scientific notation to convert it back to text.
Excel tries to be helpful, and formats some of the cells in scientific notation.
I have tried to format the column to the "Text" format prior to the import with
Columns(2).NumberFormat = "@"
This does not work. If you import the table you can see that rows 1405, 1406, 1407, 1408 all have the same scientific notation value. Their true values should be 0E0, 0E4, 0E8, 0E9 respectively.
There are quite a few other instances in the column when a text value has "E" for the second character that Excel will format on its own.
I have a series of macros I have built to automate some report manipulation at my office. One of the macros I built inserts formulas into specific columns. When I run this macro, all the formulas, save one, are populated perfectly into the column they need to be in. This particular formula is swiched over to R1C1 Reference Notation.
In the workbook I built the macro in, it inserts the formula in the correct notation. When I run the macro in a different workbook, this one formula is converted to RC Notation and then is displayed as text (since the workbook is not set to the R1C1 Reference style option).
Is there a bug in my VBA code? If so, how can I correct this?
I use Excel 2007. Macros are saved in my Personal.xlsb workbook. All other forumlas populated by the macro work correctly.
In a sheet the first collum is defined as a date field. However the dates a represented as a number on screen. How can I change the way it's showed on screen?
I need to have all of my number be "x10^-6", but Excel wants to make them, for instance, 7.66x10^-3, when I need it to read "7660x10^-6". How can I force excel to do this?