1. U

    Finding last row of column not recognizing all rows in column

    Hello, I've created a workbook with 4 worksheets that have been copied from other workbooks. In this workbook I'm trying to copy and paste all data from a column in sheet1 to sheet2. I'm using the following vba code: Dim lastRow As Long lastRow = Cells(Rows.Count, 1).End(xlUp).Row...
  2. R

    Relative reference in the use of the formula left VBA

    I created this macro to count the number of rows starting from column B. Then I created a cycle to fill columns 3,4,5 and 6 with excel formulas. my problem is that the references should be relative and not absolute (b5,b6,b7 and c5, c6,c7...until the last line). I can't finish the macro. Can you...
  3. H

    Trying to set VBA range to last row with values--duplicate declaration error

    Hello, I'm creating an excel template with a formatting macro. The template will have data of varying length added to it (could be 10 rows, could be 1000). I created a macro using Record Macro, then added a section to add a border after each unique value in the last column. It's working great...
  4. G

    If cell has data, move down 1 row and paste

    Good morning, I have the following macro. I simply want it to look at A1 on the current worksheet, if that cell has data then move down to A2. Then the next time I important data it will look at A2 and paste in A3 etc. Not quite sure how to do this myself, any help is appreciated! Private...
  5. W

    Using last row in this code

    Hello, I have an excel database with about 50 unique sheets. The formatting of these sheets is the same in all cases but each worksheet is for a different supplier, some worksheets contain 10 rows, some 450+ I made an userform, to make it easier to add, edit, etc. the products listed on these...
  6. C

    VBA copy LEFT function / formula down all cells in column

    Hi guys! Long time reader, first time poster. Getting very frustrated with my VBA so any help is appreciated. In my worksheet "Paste Data", I have a string of text in column G and need to use the LEFT formula to find and copy the text before the character " - " into column H. My VBA code...
  7. A

    Add entry at the end of a list with a UserForm

    Hi guys, I am trying to write a code within a userform which can be used to enter data on 3 columns. The columns are F, G, H and the row start from row 4. But when I try to run the code I get an object error on ActiveSheet.Cells(lastrow + 1, 6).Value = TextBox1.Value. I'm new to VBA so the...
  8. U

    Copy Range of Cells And Paste Until Last Row

    Hi guys i have a page in range A41:H74 and i want copy this page and paste until last row of excel sheet. does any vba code to do this?
  9. M

    Run macro on event

    Hi guys, I have the working code below, however when I try to added to run in a change event the Range with lastrow stops working, wondering if any of you can advice on what can I do? Sub field_change() Dim LastRow As Integer With ActiveSheet LastRow =...
  10. F

    Fill Uneven Records Across Columns

    Hi All, Could you please help me find a way to fill in the blank cells that should start from the LastRow + 1 in Col B and go until LastRow in Col C? At the moment the data is just being pasted over the lastrow in Col B. Loop in question is the last one, rest is just used to show more or less...
  11. R

    Finding Last Row/Column to Hide other Cells

    Hello, I am trying to finding the last row with a value. -I know how to do this typically by using "xlUp" but for some reason it is stopping at a cell that does not contain a value but just a change in color. -I am now trying to find a different way to go about this. Instead, I want to...
  12. E

    Formatting to last row

    I want to highlight cell b37 and until the last row (which might change) in order to format that range of data this is what i have so far, whereby i have declared at the very start of the code the following: Dim Lastrow as Long originally i had it as range("B37:B150").Select, but i had to...
  13. R

    Finding the last row that contains a value, of a column

    Hello, I am trying to select a cell in the last row that does not contain a 0. It is taking me to Row 54 but I want it to go to Row 37. The method I know is to go to a cell at the bottom of the sheet and "xlUp" so it will find the first value it finds. I want to do this but want to ignore all of...
  14. S

    Extend Selection from the Active cell to last Row i.e Non Blank cell in the same Column (having few blank cells )

    Hi , Actually I was trying to run the subroutine to select a Single Column from the Active cell and Drag the selection to the Last Row (The Single Column and Multiple Rows are having some blank cells which are to be skipped). The code below doesn't give the desired result I would appreciate if...
  15. dommmm

    Clear contents down to last row but not header VBA

    Hi, I'm having a little problem. I'm trying to determine the last row based on any data in column J and then delete the contents of cells A2 to AZ* on that last row BUT if the sheet is blank apart from the header (ie the last row is 1), then I want it to stop as the code is deleting the column...
  16. P

    Excel VBA to Outlook Select Range lastRow

    Hey guys, I need for the code to stop copying at the lat line with data, but cant figure out how to code it. Pretty sure i need to use lastRow, but Im not sure how to replace the range. Sub Main() 'For Tips see: 'Don't forget to copy the...
  17. F

    Moving rows upwards ... one at a time

    Hi, I currently have some code that looks at data in row 2 of a worksheet. After pressing a button, the VBA pulls the information from the cells in that particular row, through to other cells in the workbook, it then automatically saves this info as a new document and then returns to the first...
  18. J

    VBA dynamic last row for multiple sheets

    Ok so I'm a bit frustrated with several failed attempts at this. I have a workbook with many worksheets. I have code to loop through each sheet (except one) and perform different calculations for certain rows. I then take those calculations and attempt to paste them 3 and 4 rows after the last...
  19. 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 =...
  20. 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...
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back