Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by vbap

  1. vbap

    how to link two different tables in two different workbook

    Toyota331, I read your statements ... they need more clarity. From what I can gather you are trying to say: You have two worksheets with data to compare and you want to highlight changed data on both worksheets where necessary and update values in resulting worksheet so that you see what has...
  2. vbap

    Read Data

    I like the Split and Join functions. I had not seen them before. Kewl.
  3. vbap

    Read Data

    When there is a comma...is there always one comma? You can use something like this if there is one comma or no comma. For Each c In rg s = Trim(c.Value) If s <> "" Then s1 = ParseString(s, ",") s1 = Add4toPrefixValue(s1) If s <> "" Then...
  4. vbap

    Read Data

    If you encounter a blank cell you'll get the invalid procedural call. You'll have to add a conditional statement...If Then...End IF. I assumed there were no blank cells or cells with literal spaces in the range. Also you might want to change Mid(Var,1) = Trim(String(s)), but it doesn't seem...
  5. vbap

    Using KeyDown on a whole form

    Ahhh. I'll have to lookup Walkenbach's example of the custom class. I've set up custom event class on the application object for workbooks but not seen an example for a Form.
  6. vbap

    Apply Excel functions to specific cells

    PROPER Capitalizes the first letter in a text string and any other letters in text that follow any character other than a letter. Converts all other letters to lowercase letters. Syntax PROPER(text) Text is text enclosed in quotation marks, a formula that returns text, or a reference to a...
  7. vbap

    Read Data

    What range of cells to you wish it to run through? The range can be any column or retangular range of cells, etc. Sub tst() Dim rg As Range Dim ws As Worksheet col = 2 Set ws = ActiveSheet Set rg = ws.Range(ws.Cells(1, col), ws.Cells(10, col)) For Each c In rg...
  8. vbap

    Apply Excel functions to specific cells

    RPrinceton...if you put the formula in A1 from what cell is the formula getting its value? Since you are trying to get the value from itself (the same cell), you get a circular reference.
  9. vbap

    Using KeyDown on a whole form

    I tried this with a form and it worked. Not sure if its good way to code. When I looked at help it suggests using the Keydown or Keyup ...which I tried. Keydown was triggered when I pressed the Control key (holding it down) and then again when I pressed the 'a' key. With a variable global to...
  10. vbap

    Using KeyDown on a whole form

    The .OnKey for the Application object should work for you. Sub ClearOnKeyInterrupts() With Application '.OnKey "{END}", "" .OnKey "{HOME}", "" .OnKey "^{a}", "" '.OnKey "^{q}", "" End With End Sub Sub SetUpOnKeyInterrupts() With Application...
  11. vbap

    Read Data

    I like it PHV.
  12. vbap

    Read Data

    Here's an approach. You can modify to suit your needs. I assumed that you wanted it to stop at any character after the prefix value you're seeking. Sub tst() For Each c In Selection Var = Trim(c.Value) s = Val(Var) + 4 Mid(Var, 1) = s c.Value = Var...
  13. vbap

    How to replace values in cell?

    Hey PH, Very cool little routine. Not ever thought of that approach.
  14. vbap

    Dealing with 'empty' cells in a formula

    If the cell contains nothing not even "" ....try If IsEmpty(ActiveCell)=True then my_variable=0 Else my_variable=ActiveCell.Value End If Null is not the same as Empty, which indicates that a variable has not yet been initialized. It is also not the same as a zero-length string (""), which...
  15. vbap

    Not allowing users to run macros from Tools-Macros

    I believe only public subroutines show up as macros. You can convert your subroutines to functions and they won't show or you can do what Frederico says: Change your subroutines from public to private. Private subroutines do not show either. However if you have subroutines in one module that...

Part and Inventory Search

Back
Top