Search:

Type: Posts; User: Trebor76; Keyword(s):

Page 1 of 6 1 2 3 4

Search: Search took 0.21 seconds.

  1. Replies
    7
    Views
    109

    Re: Conditionally insert rows

    Hi CakzPrimz,

    Try this:


    Option Explicit
    Sub Macro1()

    Dim lngLastRow As Long
    Dim lngMyRow As Long
  2. Re: Run the function when the first 5 cells have at least one figure

    Thanks for letting us know and you're welcome :)
  3. Re: Run the function when the first 5 cells have at least one figure

    Oh OK. Maybe this then:

    =IF(COUNTIF('1'!B2:B6,"NA")=5,"NA",INDEX(('1'!$A2:$A262),MATCH(MAX('1'!B2:B262),'1'!B2:B262,0)))
  4. Re: Run the function when the first 5 cells have at least one figure

    There's no need to test as the result would be #NA if any of the cells in B2:B6 are in error anyway :confused:

    That said you could use this:
    ...
  5. Replies
    8
    Views
    156

    Re: Macro for column of formulas

    Here's my attempt:


    Option Explicit
    Sub Macro1()

    Dim rngMyCell As Range
    Dim lngMyRow As Long

    Application.ScreenUpdating = False
  6. Replies
    3
    Views
    123

    Re: yes/no pop up message box

    Here's my attempt:


    Option Explicit
    Sub Macro1()

    If Format(Range("A4"), "DD") = "06" Then
    If MsgBox("Do you want save the data and delete before entering new months data?",...
  7. Replies
    14
    Views
    299

    Re: Delete entire rows by contitions

    Thanks Peter. I based on it what the OP posted but you are totally correct.

    Regards,

    Robert
  8. Replies
    14
    Views
    299

    Re: Delete entire rows by contitions

    Another possibility - (just a slight twist on Peter's method):


    Option Explicit
    Sub Delete_Rows()

    Dim lngMyRow As Long

    Application.ScreenUpdating = False
  9. Re: VBA to copy data from multiple workbooks into single master xls

    I think this line...


    wkbSource.Close Savechanges = False

    ...should be this:


    wkbSource.Close SaveChanges:= False
  10. Re: VBA to copy data from multiple workbooks into single master xls

    Hi dsauter,

    Welcome to MrExcel!!

    Though largely untested this should do the job:


    Option Explicit
    Sub CopyRange()
  11. Re: Extract unmatched of 9 patterns till the 9 patterns remains 0 and continue new search

    Thanks for letting us know and you're welcome :) Thanks also for the thanks and likes ;)
  12. Re: Extract unmatched of 9 patterns till the 9 patterns remains 0 and continue new search

    Hi Kishan,

    Try this:


    Option Explicit
    Sub Macro1()

    Dim clnMyUniqueArray As New Collection
    Dim rngMyCell As Range
  13. Replies
    5
    Views
    152

    Re: What would be the best way to do this?

    You're welcome. I'm glad we were able to provide you with a solution ;)
  14. Re: get all sheet names starting with a specific letter

    Hi KDS14589,

    Try this:


    Option Explicit
    Sub WorkSheetListD()

    Dim ws As Worksheet
    Dim Counter As Long
  15. Replies
    5
    Views
    152

    Re: What would be the best way to do this?

    So my code randomly selects a row from the list (once you change the variables to suit) and displays it in a message box. Isn't that what you were after?
  16. Replies
    5
    Views
    152

    Re: What would be the best way to do this?

    Hi dpaton05,

    Let me know how this goes:


    Option Explicit
    Sub Macro2()

    Dim ws As Worksheet
    Dim strSourceCol As String
  17. Replies
    5
    Views
    117

    Re: VBA code for cutting and pasting data

    Thanks for letting us know and you're welcome :)
  18. Replies
    5
    Views
    117

    Re: VBA code for cutting and pasting data

    Yes that's exactly what's it's doing as that was my understanding for your post.

    I'm sure there's a more succinct way of doing this but see how this goes (again on a copy of your data) as it...
  19. Replies
    5
    Views
    117

    Re: VBA code for cutting and pasting data

    Hi runmageddon,

    Welcome to MrExcel!!

    Try this (though initially on a copy of your data as the results cannot be undone if they're not as expected):


    Option Explicit
    Sub Macro1()
  20. Replies
    6
    Views
    193

    Re: Screwing up a nested IF function

    Thanks for letting us know and you're welcome :)
  21. Replies
    6
    Views
    193

    Re: Screwing up a nested IF function

    Hi Merlin,

    Try this:

    =IF(D15<=200,25,IF(AND(D15>=201,D15<=399),50,100))

    Regards,

    Robert
  22. Re: VBA to Concatenate across multiple workbooks

    Hi Tooflychicken,

    Welcome to MrExcel!!

    Try this (just change the setting of the two variables I marked as 'Change to suit'):


    Option Explicit
    Sub Macro1()
  23. Re: Need Autofilter for more than 2 criteria - Array is not working

    Thanks Peter. I suppose another option for my code would be to paste rngFiltered on another tab.

    Can you build and append to a custom view?

    How's the drought in Macksville?
  24. Re: Need Autofilter for more than 2 criteria - Array is not working

    Hi Peter,

    I'm curious. I've written the following code to set a range that meets the user's requirement but don't know how to filter using it as the source - can you show me how:


    Option...
  25. Re: Need Autofilter for more than 2 criteria - Array is not working

    It works for me :confused:

    Your code uses "Activesheet" so make sure you're on the tab in question before running. The other possibility is that the tab is protected.

    Robert
Results 1 to 25 of 150
Page 1 of 6 1 2 3 4