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 derfloh 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. Andrzejek

    Filter based on condition

    You have a Space and " (double quotes) missing between AN and & (I marked it in RED): ws2.Range("A" & R2 & ":AN" & R2 + 1).Value = ws1.Range("A" & R1 - 1 & ":AN" & R1).Value Cells(RowIndex, ColIndex), so in this example Cells(R1, 4) - whatever the value is for R1 variable, that's the Row...
  2. Andrzejek

    Filter based on condition

    Give this a try. The code assumes you have 2 worksheets: first with the data you presented, and second (hopefully) empty. If the second sheet is not empty, it will be cleared by my code. Option Explicit Sub OCM() Dim ws1 As Worksheet Dim ws2 As Worksheet Dim R1 As Integer Dim R2 As Integer...
  3. Andrzejek

    Filter based on condition

    Assuming your Data is ordered by ID and Date (and Code?), you want the outcome to be: Rows where Code is: A0020 and the next row is B0480 or A0020 and the next row is C0481 or A0020 and the next row is D0550 as long as the duration between Dates of the 2 above rows is no more than a week. Is...
  4. Andrzejek

    Nested Column (Excel, CSV) : How to extract just the metadata or column names within a column of data

    May not be the most elegant code, but at the end you will get: Product_Details Product_Transfer Product_Number Product_Engine Product_Lifecycle Product_Size Product_Service Option Explicit Sub Knicks() Dim strTL As String Dim fpath As String Dim intLineNo As Integer Dim strHeader As String...
  5. Andrzejek

    Use of special characters.

    Where do you want to display it? In a Label? Text box?
  6. Andrzejek

    Is this the best way to do this query?

    If your data "come from other sources on a monthly basis" I would request: PositionID LastName FirstName EMail Phone ... ManagerPositionID Where ManagerPositionID is a ForeignKey to PositionID PrimaryKey Where I work, we also have this type of data kept by 'other sources' (third party...
  7. Andrzejek

    Is this the best way to do this query?

    Can you connect the 2 tables this way: Headcount.ManagerName = Countact_List.LastName + " " + Countact_List.FirstName or Headcount.ManagerName = Countact_List.FirstName + " " + Countact_List.LastName
  8. Andrzejek

    Need Genius Help - Finding multiple duplicates between columns - EXCEL

    OK, here is what I've got, assuming: 1. there are no Empty cells in any columns that separate data (columns can have different number of data, but once empty cell is detected, no data below for that column) 2. Data starts in Row 2 (Row 1 is a Header row) Option Explicit Sub Kim296() Dim iCol1...
  9. Andrzejek

    Need Genius Help - Finding multiple duplicates between columns - EXCEL

    I guess my question (with possible solution) is ignored :(
  10. Andrzejek

    Need Genius Help - Finding multiple duplicates between columns - EXCEL

    Kim, Would you be open to a VBA solution?. I may have (what Duane described as a) "brute-force VBA to loop through the values in each column and check values against other columns." :)
  11. Andrzejek

    Selecting shapes based on its name and then arranging them in a circle

    Did you try: ActiveSheet.Shapes.Range(Array(Split(SelectionString, ", "))).Select
  12. Andrzejek

    Update SQL's varbinary(max) field from VB6

    Update - after spending a lot of time with DBA, we could not make this process happen :( So, back to the Parameterized query. And it works! (I was so close...) Dim aryByte() As Byte Dim cmd As ADODB.Command Dim L As Long If FSO.FileExists(PDF_PATH & !FileName.Value) Then Open PDF_PATH &...
  13. Andrzejek

    Update SQL's varbinary(max) field from VB6

    I get it. I can do it on my local DB, but I need special permission to do it to other DB. I need this permission to just load the data once (I hope) so no security risk.
  14. Andrzejek

    Update SQL's varbinary(max) field from VB6

    I did try the Parameterized query, but I could not resolve the adVarBinary line Dim cmd As New ADODB.Command ... strSQL = "UPDATE SampleReport SET " & vbNewLine _ & " Body = ? " & vbNewLine _ & " WHERE SampleReportID = ?" With cmd .ActiveConnection = CnS...
  15. Andrzejek

    Update SQL's varbinary(max) field from VB6

    I have this code in VB6 application - reading PDF file into a byte array: Dim aryByte() As Byte Open App.Path & "\ABC_XYZ.pdf" For Binary Access Read As #1 ReDim aryByte(0 To LOF(1) - 1) Get #1, , aryByte Close #1 So, at this time I have my PDF in aryByte variable. Now I need to update an...
  16. Andrzejek

    Select X of each variation of a field

    Select Distinct VERSION FROM MyTable You will get: A B C Now, loop thru the outcome from above and build this SQL: SELECT TOP (1) * FROM MyTable Where VERSION = 'A' UNION ALL SELECT TOP (1) * FROM MyTable Where VERSION = 'B' UNION ALL SELECT TOP (1) * FROM MyTable Where VERSION = 'C' Run...
  17. Andrzejek

    Select X of each variation of a field

    Could you show a sample of your data in a table? And expected result.
  18. Andrzejek

    Empty recordset stops

    You can also do: If EXH.BOF = EXH.EOF Then 'No records :-( Else 'Do your magic here End If
  19. Andrzejek

    stepping through table rows

    It may not be obvious to some, but Merlijn's example was made in VB6(Classic)/VBA (Excel or any other Office app)

Part and Inventory Search

Back
Top