lastrow

  1. P

    Archive data error in code

    Hi Good morning, I hope you can help me I have a command button once clicked on it should archive the old data that has 'delivered' in a cell. But I get an error 'Run time error 9 - subscript out of range' on the line below, please also see the whole code below, hope you can help. lastrow =...
  2. P

    Problem with duplicates

    Hi All I'm using the code below to create template copies, how can i adapt it to avoid duplicates please and only create unique worksheets. Sub NewDays() Dim i As Long, LastRow As Long, wksht As Worksheet Sheets("Tides").Activate LastRow = Cells(Rows.Count, 1).End(xlUp).Row For i = 1...
  3. E

    Selection Change Macro Error when Autofilter Hides Row

    I have a selection change macro in a file that updates only when the selection occurs in the "NIIN" column of values. The macro works fine unless you apply a filter (from the preapplied AutoFilter) that hides the row that is currently being graphed and even if I select a now visible cell it...
  4. A

    help adjusted code delete empty row when transfer invoice from sheet to another

    hello, my code works but i need adjusted code when i press my macro ignore the empty rows from a19:e31 when delete these rows i suggest to be condition if a19 to a31 =0 then delete theses rows Sub TransferData() Dim Target As Range Dim LastRow As Long Dim R As Long...
  5. I

    Slight edit to existing working code

    Evening, I am using the code below but need to apply a slight change to it if you could advise please. Currently the code does not function on column 4 which is fine BUT i also wish it now not to work on column 4 and 7 Private Sub Worksheet_SelectionChange(ByVal Target As Range)...
  6. spencer_time

    Active worksheet as variable broken

    Hello guys, I need help again. I have a snippit that works when the sheet is defined (sheet3) but doesn't work when I try to make a variable for the active sheet (ws). I get an error that says "object doesn't support this property or method" and when I press debug it highlights my variable ws...
  7. D

    Hide columns that have whole rows TRUE

    Hello all, I have some table build up from different formulas and so on. Final result is some huge sheet filled with columns and lots of rows showing just True or False. I'd like to know how i could hide all columns that are all their values True, so i can just end up with just the False...
  8. G

    Vba Delete row if data from another cell exists

    Hi, I have the below code however I need to change it to reference cells C4-C4 and delete the row, if Column H contains the data typed in cells C4-C7. Thank you for any help . Sub Loop_Example() Dim Firstrow As Long Dim Lastrow As Long Dim Lrow As Long Dim CalcMode As Long...
  9. S

    Help to set lastrow, lastcolumn minnimum

    Hi all I want to set lastrow always "> 4" and lastcolumn always ">6". I have code belovew and work well but I thinks have a better way to do. Could you have any suggession to do? My code is: Sub clear()Dim lrow As Long, lcol As Long Application.ScreenUpdating = False With Sheets("result")...
  10. T

    VBA - Copy.Range to paste values only?

    Hi, I am writing some code to copy and paste a range from one sheet to another but the code is bringing the formula through to the new destination whereas I only need the values. Current code: Dim Arange As Range, Drange As Range, Crange As Range, Trange As Range Set Arange = ws.Range("A3:A"...
  11. J

    Cleaning up records

    Hello: I have part of a macro that needs to clean up cells and replace the bad data with the good data. I'm using a loop nested if else, but is there a more efficient way? This looks cumbersome. Any help would be appreciated . Thank you! Sub cleandata() Dim i As Long Dim DataValue...
  12. E

    Dim lastrow As Long not working?

    Can anyone help please? It looks right to me but when the macro finishes, it pastes my formula in AC1:AC3. There are breaks in the data however, by pressing Ctrl and End it takes me to cell AC520. Sub ConsolidateTimeSheets() Dim Wbk As Workbook Dim ws As Worksheet, wsData As Worksheet...
  13. S

    Create 3D Cell References with Macro

    Hi all... me again *sigh* I am trying to create a macro that will create a 3d-reference to another sheet - all references need to be added to the sheet 'Reminders' and will be based on the values in the active row on the active sheet. I kinda had two macros that did bits of what I wanted and...
  14. A

    Copy/Paste and remove duplicates

    Hi all I have done a macro to copy data from sheet2 to sheet 3 then remove duplicates, however it doesn't work, please could anyone help? Sub Reconcile() Dim LastRow AsLong LastRow =Range("A" & Rows.Count).End(xlUp).Row Sheet2.Select Range("F2:F" & LastRow).Select...
  15. L

    VBa automatically run macro if cell changes

    Hi all, I want to make the spread sheet automatically run this macro code when a number is inputted into column B what code do i need to add to it Sub Ratio_BC() Dim Lastrow As Long Application.ScreenUpdating = False Lastrow = Range("B" & Rows.Count).End(xlUp).Row Range("D2:D" &...
  16. L

    VBA autofil formula in Collumn D if data is inputted into column B

    Hi all, I am in need of a VBA code to be able to autofill this formula "=IF(ISNUMBER(--MID($B:$B,SEARCH("241",$B:$B),3)),MID($B:$B,18,10),0)" into column D anytime datat is inputted, this is an attempt to limit the amount of formula's are in the sheet as i dont want to have to copy the formula...
  17. D

    Move row then delete blank

    Hi all, could someone help me mod this to delete each blank row after it has moved the data to another sheet. Currently, it works when there is only one "Y" marked row but, if there are multiple rows, it does not delete any of the blank rows. Sub Move_Closed()Dim Check As Range, rng As Range...
  18. D

    VBA mod

    Hi all, can someone help me to mod this so that when the rows identified are moved to another sheet the subsequent blank row is deleted from the source table, please? Sub Move_Closed()Dim Check As Range, r As Long, lastrow2 As Long, lastrow As Long Application.ScreenUpdating = False lastrow =...
  19. A

    VBA code is not working

    Hi, I am getting "Application-defined or object-defined error" error msg for below codes.. Not able to figure out where i am going wrong. Please help Sub conditionE() Dim lastrow As Long lastrow = WorksheetFunction.CountA(Worksheets("2018_T933").Range("A:A")) With...
  20. K

    vba print area

    hello all, i have a worksheet with column A-I, row 1-250. however i'm not necessary to use every row every time. the question is how can i simply set the print area automatically to last row thus i can use less paper?:rofl: it seems my code below will goto row 250 every time and i will print...

Some videos you may like

This Week's Hot Topics

Top