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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. 01Patrik

    Listing with picture on Excel

    If you slect all pictures /F%/Spcial/"Objects") and make sure that the pictures move with cells ('Format picture', properties tab) and the fill the cell with something (a space would be sufficient). Now try sorting again, make sure the column with the spaces are sorted as well. Should do it...
  2. 01Patrik

    Connect Word Doc to SQL

    Take a look at faq707-5844 in the VBA forum. You'll need to adjust to Word of course, as well as adjust the connection string, but the basics about ADO and recordsets apply. // Patrik ______________________________ To the optimist, the glass is half full. To the pessimist, the glass is half...
  3. 01Patrik

    Excel - Access (Is it understood correctly)

    For your query this sql qould be sufficient ... WHERE CASE WHEN field>=10500 AND field<=16000 THEN 1000 ELSE field/10 END AS resultheader ... // Patrik ______________________________ To the optimist, the glass is half full. To the pessimist, the glass is half empty. To the IT Professional...
  4. 01Patrik

    Edit OLE DB Query

    quite possible. define the connection string as a string variable, and combine with if, case or any other method to return "april05" as a string value. 'This can by calculated on DATE, entered like string (like below) or retrieved from a cell, possibilities are unrestricted MyMonth =...
  5. 01Patrik

    Stopping Excel Macros when started from VB

    Use application.enableevents = false disables all events (workbook_open etc) DON'T forget to set it back to true again, it's one of those settings that doesn't turn itself back on again automatically... use application.displayalerts = false to turn the save questions etc off. Same thing there...
  6. 01Patrik

    Excel VBA Error (Locking Excel)

    As Harley said, setting the security level to medium/normal, and disabling macros when asked does the trick. But you can normally abort the code once it's running, by multiple times pressing [ESC]. Then you'll (probably) be asked wether to abort or debug. Choose debug, and you'll face the code...
  7. 01Patrik

    Excel, Automatic saving when end program,,

    All right quys, enough with the irony. Nitha, in future cases, try to find information in other locations than these foras, since what your asking for is very basic. You'll probably find it in the FAQs or by using SEARCH as well. However, I believe all questions asked politely deserves an...
  8. 01Patrik

    Access query using Excel VBA

    ...since you're JOINing on workorder_number, it seems to me that the entire GROUP BY part is unnesseccary. However, I'm no Sql expert, and the problem might be situated elsewhere. Nut as I said previously, if the code (VBA) is executed without problems, then the issue lies with the sql string...
  9. 01Patrik

    Access query using Excel VBA

    When using .movenext on your recordset, and the do - loop functions as you are, you are making yourself voulnerable for spelling mistakes etc. Take a look at faq707-5844 , which lets you return the Recorset to Excel without defining the column headers and which field going where. I'm not...
  10. 01Patrik

    How can I use VBA to get my Access into Excel?

    The following lets you define your query as a string variable, creates a connection to an Access database you define (with or without username and password), opens a recordset to the open database, returns the result of your query (including headers) to the active sheet in excel, closes and...
  11. 01Patrik

    excel inserting and re-naming worksheets using a macro

    Your data is 'Sheet1' in code below. If you insert a sheet ('Sheet2') with all the new sheets names in Col A and the thing to filter for in Col B, starting at row 1 (no headers), then something like this should do: dim n as integer, ShN as string, Cr as string sheet2.activate for n = 1 to...
  12. 01Patrik

    Freeze Panes Problem for one of my users

    In later versions the grayed out option would indicate that the share is protected (tools, protection, portect shared workbook) with a password. I suppose you mean she cannot unfreeze the panes? If she can, can she freeze them again? Since VBA cannot be edited in shared mode, can you unlock...
  13. 01Patrik

    Maximize user form in Excel app.

    ftoddt, You can of course adjust the size of your form with IF-statements or select case on height/width. Same thing with font size etc: Private Sub UserForm_Initialize() Dim i As Integer, MySize As Variant Application.WindowState = xlMaximized UserForm1.Height = Application.Height...
  14. 01Patrik

    Excel Merging

    Take the list (PT) you have, turn into values (copy, paste special: values), add two columns: TYPE2 and DESCRIPTION2 In my example below the columns are set as follows: YEAR = Col A, TYPE = Col B, Desc = Col C, PARTNO = Col D, PRICE = Col E, TYPE2 = Col F, DESCRIPTION2 = Col G I'm also...
  15. 01Patrik

    In Word, SaveAs MS-DOS Text avoid warning prompt

    DON'T FORGET to turn it on again in the end of the code - that is a setting that doesn't turn on again manually! // Patrik ______________________________ To the optimist, the glass is half full. To the pessimist, the glass is half empty. To the IT Professional, the glass is twice as big as it...
  16. 01Patrik

    Excel Merging

    Hi, I'd go with a pivot table on two columns of data - PART CODE and PART DESCRIPTION from BOTH tables (2004&2005) on top of each other. Put both fields in ROW in the pivot table layout form, and whatever in DATA (like Count of Part etc), then finish. Now you'll have a 'totals' row between...
  17. 01Patrik

    VLookup with excel multiple columns

    Perhaps this is what you want - but it is limited to two search criterias. Public Function VLOOKUP2(Search1 As Variant, Table As Range, ResCol As Integer, Optional Search1Col As Integer = 1, Optional n As Integer = 1, Optional Search2 As Variant = False, Optional Search2Col As Integer) '...
  18. 01Patrik

    Excel Combo Box

    The combobox is returning a cellcount inside the range of your combobox - meaning that if it returns a 2, it is the second value of the combobox range. There are several ways of getting the actual value in your cell (if I understand your questions correctly?): 1/ Use HLOOKUP, same range as the...
  19. 01Patrik

    Excel date problems

    Littlewoman, Your suggestion will only work if excel treats the date the way David wants from the beginning. The problem here is that Excel interprets the date provided according to the regional standards in Davids computer(mm/dd/yyyy), rather than the format of the data provided (dd/mm/yyyy)...
  20. 01Patrik

    Excel date problems

    If you can get the data as text into Excel, there are many ways of achieving what you want. One is using DateSerial along with left/right: MyDate = DateSerial(right([A1].value,2),left([A1].value,2),right(left([A1].value,5),2)) // Patrik ______________________________ To the optimist, the...

Part and Inventory Search

Back
Top