lastrow

  1. S

    Including LastRow within a formula

    Hi All, I have some code which creates a "score" line within my spreadsheet. I need this formula to change each time I run my macro, as the number of questions it relates to is variable. I have the formula: Range("B" & LastRow + 3).Value =...
  2. M

    database manager

    Hello, I explain my problem, I create a database manager, to use it is very simple, in the sheet BDD Chat you will find a button that opens the manager, once open you will find a combobox that lists the name of the lists, a listbox which lists the items within a list, 1 button add a list, 1...
  3. D

    VBA delete last row help

    Hello everyone. I am trying to piece meal my VBA where I need it to select all sheets in the workbook and delete the last row in each sheet. Each sheet has the same headers but varies in row so as long as it is the last row being deleted it will work. Any pointers would be greatly...
  4. P

    Using Lastrow

    I’m trying to learn to write a sub without having to continuously repeat the Range on every line of code by using the command Lastrow. Below is a simple example of a Range A1:H15. <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> </o:OfficeDocumentSettings>...
  5. D

    Autofill goes past Last Row, Last row identifies correct Row

    Hi I have done lots of Google searches and found nothing on this. Normally I can find an answer on Google, or force the code to do what I want by trying a different method. I have a VBA problem that is driving me nuts. I'm using End(xlUp) to find my last row. When I hover over Last row...
  6. H

    Excel VBA to rename filesname or folder

    Hi Any idea why this not working? :D Sub ChangeInFolder() Dim OldName As String Dim NewName As String Dim LastRow As Long Dim i As Long LastRow = Range("A65536").End(xlUp).Row For i = 1 To LastRow OldName = Range("A" & i).Value NewName = Range("C" & i).Value Name OldName As...
  7. A

    Setting data range and speeding up VBA code

    Hi, I have some simple VBA code which does not work the way I want. It's probably something simple. First, in the code LastRow = Cells(Rows.Count, "B").End(xlUp).Row I would like to start the row count at row B3 not row B1; tried several options but all returned errors. Sub Test2() Dim...
  8. sharky12345

    Efficient method to add hyperlink

    Afternoon guys, I'm trying to find an efficient method to add a hyperlink to a range of cells but what I have so far keeps generating an 'Out of memory' message. The code itself runs fine, but once it's complete I get the message. This is what I have so far: LastImportRow =...
  9. C

    Help fixing 'Subscript out of range' error

    I'm trying to teach myself about arrays and can't seem to figure this one out. (many Google searches) I have the following code that I'm getting a 'subscript out of range' error: <subscript out="" of="" range="">Dim LastRow As Integer Dim MyArray As Variant Dim i As Integer With...
  10. T

    Find the last row with data in it in a row of formulas?

    Hi Everyone, I have a small range of BJ28:BJ42 I want to find the lastrow that contains data, they all contain formulas so my normal lastrow method select every row, but the formulas have "(IF a21 = "","")" for example so some cell go "", I want the last row that has a value in it. Please help...
  11. S

    "Paste method of Worksheet class failed" but only on alternate executions

    Hi folks, can anyone tell me why this works every alternate time it's run? Run it and it works fine. Run it again "Paste method of Worksheet class failed" Run it again it works fine. Run it again "Paste method of Worksheet class failed" etc..... Thanks. Sub CopyRows() Dim RowNum As Integer Dim...
  12. K

    Find last row value from multiple sheets and copy those values to another sheet

    ok got this far and the masg box shows last row values but having trouble on figuring out how to put those values in Sh5 column O , so it finds the last row in sheets 1 -4 , just want to paste the last row value into 4 cells starting at O1= lastrow hS1, O2=lastrow Sh2,O3= lastrow Sh3 and O4=...
  13. 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 =...
  14. 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...
  15. 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...
  16. 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...
  17. 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)...
  18. 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...
  19. 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...
  20. 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...

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top