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 TouchToneTommy 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. sterlecki

    Macro or function

    Thanks alot Skip the new version worked like a charm. I made one modification to force the alpha characters to lower case. Function testit(rng As Range) Dim a, s As String, byt As String, i As Integer, sOUT As String a = Split(rng, " ") testit = Left(a(0), 1) s =...
  2. sterlecki

    Macro or function

    Skip and Tony thanks for your input and sorry about the late reply. Tony I tried saving the formula. Didn't know that was possible. Can named formulas be accessible from other workbooks similar to the personal macro workbook? If I could do that I can think of alot of utilities that I use...
  3. sterlecki

    Macro or function

    I have created a rather complex formula to parse out some text data into a specific format. I would like to be able to store this as a function and/or be able to apply this formula as a macro to a long list using a FOR EACH...NEXT statement. How can I save this formula as either a function or a...
  4. sterlecki

    Dynamic Range Syntax

    Skip and PHV Assigned you both stars but forgot to include a Big Thanks! Entire code now runs perfectly. Don't know how we'd all survive without your help.
  5. sterlecki

    Dynamic Range Syntax

    That was it PHV Sub testit() With ActiveCell 'paste active cell value in column .Copy With ActiveSheet.UsedRange Range(ActiveCell, .Cells(.Row + .Rows.Count - 1, ActiveCell.Column)).PasteSpecial xlPasteAll End With End With End Sub Works...
  6. sterlecki

    Dynamic Range Syntax

    When I copied your last entry AS IS into a new worksheet. I placed data in column A rows 2 to 10 and data in B2 making this the active cell. When I ran the macro it said compile error: Variable not defined and highlighted UsedRange If I placed a statement: Dim UsedRange as range I get the...
  7. sterlecki

    Dynamic Range Syntax

    Skip, I get an error at the highlighted line. "Object Variable or With block variable not set. Sub SetColumnWidth15() ' ' SetColumnWidth15 Macro ' ' Dim strRecordB As String Dim r As Integer Dim i As Integer Dim y As Integer Dim x As Integer Dim c As Integer Dim...
  8. sterlecki

    Dynamic Range Syntax

    Skip, I'm closer than I was but it is pasting all the way to the last available row in the worksheet. Obviously the usedrange property has it's limitations if the worksheet has been previously altered. How can I limit the pasting to only the rows with data in the adjacent column to the left?
  9. sterlecki

    Dynamic Range Syntax

    I'm having trouble with the syntax when naming a range for pasting the value of a single cell into the same column but down to the last row of data. So if Activecell.address is $D$2 X = Activecell.column (ie 4) Y = activecell.row (ie 2) r = ActiveSheet.UsedRange.Rows.Count (say it's row 5) I...
  10. sterlecki

    Pick a Directory folder

    PHV I have noticed that when the pick folder screen displays for the user to choose the location for the output, should the user change his mind and click cancel the routine continues to run and output the report. I'm confused as to whether there should be some sort of cancelled event in the...
  11. sterlecki

    Pick a Directory folder

    strStartDir = PickFolder(17) After making this change and choosing Desktop it saves the file to there as well. Many thanks Case Closed
  12. sterlecki

    Pick a Directory folder

    Good News. The following code works with a few caveats: With Me.frame_ChooseReport Select Case [frame_ChooseReport] Case 1 stDocName = "rpt_WellHeader_Pinedale" If Me.lbo_PrintSelectWells.ItemsSelected.Count = 0 Then MsgBox ("No Items Selected for Printing")...
  13. sterlecki

    Pick a Directory folder

    Function PickFolder(strStartDir As Variant) As String Dim SA As Object, f As Object Set SA = CreateObject("Shell.Application") Set f = SA.BrowseForFolder(0, "Choose a folder", 16 + 32 + 64, strStartDir) If (Not f Is Nothing) Then PickFolder = f.Items.item.Path 'PickFolder = ("My Computer")...
  14. sterlecki

    Pick a Directory folder

    When I stepped through it failed just after this statement from your PickFolder function PickFolder = f.Items.item.Path
  15. sterlecki

    Pick a Directory folder

    The error occurs upon selection from the "Choose Directory" display.
  16. sterlecki

    Pick a Directory folder

    Only and error message box on the form. Nothing highlighted in Debug on the code.
  17. sterlecki

    Pick a Directory folder

    PHV When I replace Call PickFolder(strStartDir) with this: strStartDir = PickFolder(0) as suggested I get an error "Object variable or With block variable not set" MazeWorX thanks for catching the spaces but it had no positive effect for output. The file is not being created. could it be...
  18. sterlecki

    Pick a Directory folder

    Sorry the line of code that doesn't work should read as follows: DoCmd.OutputTo acReport, stDocName, acFormatPDF, strStartDir & " \ " & FileName & ".pdf", False, "" I posted an edited line that didn't work either.
  19. sterlecki

    Pick a Directory folder

    thread705-1380756 Using PHV's PickFolder function (see thread above) I've created the following code: Private Sub cmd_PrintProg_Click() 'Perfoms Print report routines based on the option group selections On Error GoTo Err_cmd_PrintReport_Click Dim stDocName As String Dim stDocName2...
  20. sterlecki

    Determine Most Recent DateModified from multiple tables

    thank you all for your suggestions. The solution that I will use as a list box on my report is: SELECT TOP 1 * FROM (SELECT "WellHeader" as TableName, Format(Max(DateModified),'mm/dd/yyyy') AS LastDateModified FROM data_WellHeader WHERE API=[Reports]![rpt_WellHeader_Pinedale]![API] UNION...

Part and Inventory Search

Back
Top