Search:

Type: Posts; User: Kenneth Hobson; Keyword(s):

Page 1 of 6 1 2 3 4

Search: Search took 0.15 seconds.

  1. Re: Specifying All Members of an Array

    You can see from the code that you can add a parameter to set sort order. This is "sort" of what the 3rd parameter of =Rank() sort of thing. Even so, it is not perfect. Compare with some tests in...
  2. Re: Specifying All Members of an Array

    Arg2 of the function requires a range.

    Maybe something like this. View the Immediate Window in VBE after a run to see the results.

    Sub ranker()
    Dim c, allVals, Rank, i As Integer
    ...
  3. Replies
    2
    Views
    112

    Re: convert function to a Sub

    lblWotM.caption = WeekOfMonth(CDate(DTPicker1))
  4. Replies
    5
    Views
    99

    Re: email area using Yahoo

    If you are using Outlook and want to use the htmlBody method that Leith explained, see: https://www.rondebruin.nl/win/s1/outlook/bmail2.htm

    Ron de Bruin has CDO examples as well.

    There is also...
  5. Re: Moving vba code from one workbook to another (using vba)

    My guess, without seeing your code, is no for simple copy paste. Doing it in a macro would depend on your code. Likely, a VBAComponents method would be needed.

    A copy of the worksheet to a new or...
  6. Re: What is wrong with my select case statement

    Set is for objects. A string is not an object.

    Dim city As String
    'Set city = ThisWorkbook.Worksheets("Start_here").Range("H9").Value
    Select Case ...
  7. Re: VBA Help - Search Column For String, Do Something, Repeat Search

    Sub Main()
    Dim ws As Worksheet, r As Range, c As Range, d As Long, ID, s As Sheets, a

    ID = 12345
    Set s = Worksheets(Split("Sheet1,Sheet2,Sheet3", ","))
    'Set s = Sheets 'All...
  8. Re: Grab corresponding value from a data range

    You lost me. If something changed, then post another picture that might help.

    You can use a tool from here to make things more clear maybe. ...
  9. Replies
    6
    Views
    136

    Re: Open This Workbook.Path

    If the drive or path or filename does not exist, it won't "work". A hard coded drive:\path\filename.ext has the same limitation as the dynamic path that you set. You can use Dir() to determine if...
  10. Replies
    27
    Views
    466

    Re: Help with VBA

    The code that we posted runs when a calculation event occurs on that Sheet.

    Your Sub, is public so it would go in a Module. You could easily put my sub into yours or call like any "sub"routine if...
  11. Replies
    27
    Views
    466

    Re: Help with VBA

    My version keeps track of the last move in Sheet2!Z1.

    Right click your sheet's Tab, View Code, and paste:

    Private Sub Worksheet_Calculate()
    Dim c As Integer

    c =...
  12. Replies
    2
    Views
    111

    Re: Row Height VBA

    I don't know what you mean by Form. If you mean copy a range and paste to another:

    Sub RunCopyPasteAll()
    Dim rSource As Range, rTarget As Range, s As String
    Set rSource =...
  13. Re: Grab corresponding value from a data range

    In N4, fill down:
    =IF(COUNTA(B4:L4)<>0,OFFSET(A4,0,MATCH(1,$B$2:$L$2,0)),"")

    This could be dressed up a bit to check if the value was "" rather than the whole row.
  14. Replies
    11
    Views
    264

    Re: VBA Run time Error "424

    I have not tested but maybe:

    Sub Copy_Move_Files()
    Dim fso As Object
    Dim Cl As Range
    Dim Fldr As String

    Set fso = CreateObject("scripting.filesystemobject")
    With...
  15. Replies
    3
    Views
    90

    Re: I am Hoping to Find a Sort Macro

    You could have posted the recorded macro. I did it below Main().

    You can change activesheet to another worksheet not active like this:

    Set ws = Worksheets("SomeOtherWorksheetTabNameHere")
    ...
  16. Re: Environ use (blackslash vs. forward slash)

    You passed a hard coded string. The others returned the value of sPath, not the string of sPath itself.

    You can put this in a module to compare:

    Sub Test()
    Dim sPath As String
    sPath...
  17. Re: Environ use (blackslash vs. forward slash)

    That is because there is no operating system command nor application called: C:\Program Files\Windows Media Player\wmplayer.exe sPath
  18. Re: Environ use (blackslash vs. forward slash)

    Think of Shell() as if it were the old DOS command shell. It did not allow space characters. So, if a path had it, it would fail. e.g. Dir Program Files. To work, do, Dir "Program Files"

    You can...
  19. Replies
    3
    Views
    90

    Re: I am Hoping to Find a Sort Macro

    The easiest way to record a macro if you really need one.

    1. Record the Sort ascending column AT.
    2. Use AutoFilter or Advanced Filter and Filter in Place. The number filter or criterion would be...
  20. Re: Environ use (blackslash vs. forward slash)

    Either or is ok.

    If that file type is associated with the application that you want to open with it in Windows:

    Shell "cmd /c " &"""" & _...
  21. Re: Is there a way to show different currencys i.e "" or "$" depending on the text in a cell?

    Hopefully, you are using a currency correction value in your formulas.
  22. Re: Need help to fix Dir error (Run-Time error 5) - Invalid Procedure or argument call

    No.

    OffExists = Dir(oPath & ImageChange & ".*")<>""
    FileExists = Dir(fPath & ImageChange & ".*")<>""
    OriginalFile = Dir(fPath & ImageEnter & ".*")


    FSO also has a way to check for...
  23. Replies
    4
    Views
    147

    Re: Make an image snap to a page

    By any sheet, I don't know if you meant sheet or page. I will guess that you meant page on a sheet. In fact, as coded, it would have to be the last page on a sheet if column A is the must fill...
  24. Replies
    4
    Views
    147

    Re: Make an image snap to a page

    Is lr always on page 1 or could it be on some other page number on that sheet?

    Be sure to obfuscate any sensitive data in a post. e.g. passwords, emails, ssn, phone, etc.
  25. Re: Need help to fix Dir error (Run-Time error 5) - Invalid Procedure or argument call

    Here is the way x = Dir works. After the last Dir, it uses the input from it. Your last Dir before the one in the loop is:

    OffExists = Dir(oPath & ImageChange & ".*")
    Move this line to before...
Results 1 to 25 of 150
Page 1 of 6 1 2 3 4