cellslastrow

  1. E

    Bringing me back to a sheet

    Hey all, I have this copy and paste code for a button. Here is the code: If Range("B16").Value = "Dog" Then Sheets("Animals").Range("A16:D19").Copy Sheets("Finished").Activate lastrow = Range("A65536").End(xlUp).Row Cells(lastrow + 5, 1).PasteSpecial...
  2. E

    Keeping Cells hidden when Copying and Pasting

    Hey everyone, I am trying to Copy data from one sheet and paste it into another. I want the rows that are hidden to stay hidden when they are being pasted instead of reappearing. I am guessing it is a Paste option, but I don't know which one. Thank you in advance. Here is my code I am using...
  3. R

    Copying data between workbooks

    Hi I'm trying to copy data between workbooks, but i'm getting an 1004 run time error, on the range object that i'm using viz. Workbooks("Origin.xlsx").Worksheets("Data").Range(Cells(1, 1), Cells(lastrow, lastcol)).Copy Workbooks("Destination.xlsx").Worksheets("Copy").Range("A1") Please...
  4. L

    union range into array

    Hey guys, I'm trying to dodge making cycles to fill up my array, so i was hoping to just do this: lastRow = Cells.Find(what:="*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row Set bigRange = Application.Union(Range(Cells(2, 3), Cells(lastRow, 3)), Range(Cells(2, 4), Cells(lastRow...
  5. P

    Passing data from one userform to a formula on another userform

    In the code below, I declared lDz and lCs as public variables so I can use them in a formula located on another user form. Unfortunately the values will not pass to the formula and I get a Run-time error '11': Division by zero. I even created invisible text boxes and tried to assign the values...
  6. most

    Copy and paste a column from one sheet to another

    I can't get the code below to work, anybody can see what the issue is? Or have a better way to solve it? What I want the script to do is to copy data from a column to another sheet in a another workbook. Multiple times, so I need to reuse code to make it sustainable. As you can see in the...
  7. S

    VBA - Data Entry Sheet

    I have a workbook with 4 sheets. The "Input Sheet" has data made to resemble a Userform (Cells B4,B6,&B8 have descriptions and cells C4,C6,&C8 have bank cells for data input). Sheet1, Sheet2, & Sheet3 are all the same with A1,B1,&C1 containing the headers laid out in the Input Sheet...
  8. P

    Runtime Error 91 Object variable or with block variable not set

    All I am wanting to do is if the item information is not found in the spreadsheet add it to the next available line but if it is found, locate the address and add the missing items by offsetting it from the location address. The error occurs on the code below and I have included all the code...
  9. A

    Type Mismatch Error When calling Sub

    Hi I have a procedure that runs fine when I run it standalone but when I call it from another sub it generates a Type Mismatch Error (run time error 13) For i = 4 To ColNum Cells(8, i).Value = Cells(4, i) / Cells(5, i) 'calculate standardized Sheets("Probit").Cells(11, i).Value =...
  10. L

    Run time Error '9'

    I am getting a run time error '9' subscript out of range (in red) and I'm unsure why since it was working and now not working. I obviously changed something but I'm unsure what I did. Any help with this code would be appreciated. Thanks. Sub DistributeFromBiWeeklyPayroll() Dim R As Long...
  11. D

    Execute different formulas based on conditions

    I have the below code in Sheet1; Cells(lastRow + 10, "R").FormulaR1C1 = "=R[-4]C+R[-4]C[-3]" How can I adjust this such that; - If cell F1 in the 'Man' worksheet = 1 then Cells(lastRow + 10, "R").FormulaR1C1 = "=R[-4]C+R[-4]C[-3]" - If cell F1 in the 'Man' worksheet <> 1 then...
  12. D

    Cell border on Totals number at bottom of range

    Hi, I have a dynamic range with column headings (from columns A to R) for which I need to add totals to each columns from L to R. I have the following code which works; Dim lastRow As Long lastRow = Cells(Rows.Count, "D").End(xlUp).Row Cells(lastRow + 3, "L").Formula = "=SUM(L2:L" &...
  13. L

    Error handling question: if sheet doesn't exist, go to

    Hello, I have the codes below to basically copy and paste some data from one workbook (book23) to other workbooks. the problem is that sheet "WDed15" may not exist. Can someone show me how to add an if statement to test if sheet("WDed15") exists, if it does, continue to execute the entire...
  14. A

    Open File and Reference Workbook

    I have a code that searching for values and if match is found overwriting existing values, if not match found adding new records. The code does what I need except of one thing. I want to replace Sheet2 reference with an external user-selected workbook. I presume that I have to use...
  15. D

    Excel Email Macro with Hyperlink Help

    Hi everyone, hew to the board here and I'm in need of some assistance. I have a macro built in excel to send out an email and I have my template and everything set up, but I'm having issues with the hyperlink functionality. I can get it to point to a specific location (ex...
  16. D

    Looking for HTML Link for Local Folder Location Based on Cell Values

    Hi everyone! I've been all over this forum trying to figure out a solution for my macro, but I've having trouble and could really use some help! I've created an excel document where a user will fill out let's say Row 2 with specific information and then when you hit the macro button I've...
  17. V

    Add sheet2 name in For..Each loop code..

    I have new question here.. Please see my below code.. In red line code, I want to use Sheet2 now..How do i edit this..can any help.. Dim FndTxt As Range, zVal As Range, Fnd As Long Set FndTxt = Range("AA3") For Each zVal In Range("Z501", Range("Z" & Rows.Count).End(xlUp)) **** =...
  18. D

    Run time Error "1004"

    ****demo.xlsm file link https://drive.google.com/open?id=0B1u8QGSQIxdoeXRvRHd2THVaenM following code is working only for 28 Ranges which is 15849 cells (highlight in red color) but not running with all ranges that past below in brown color Find same value and Changing a cell & tex color...
  19. K

    Paste Special Method of Range Class Failed

    kindly solve this issue my code is Private Sub Button9_Click() Sheets("sys").Range("A9142:A20000").Copy Dim lastrow As Long lastrow = Range("A9249:A20000").End(xlUp).Row Sheets("Sheet1").Activate Cells(lastrow + 1, 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone...
  20. P

    Increment alphanumeric sequence to next row by 1

    Good day, I've found a macro online that increments cells with numerical value by 1 and inserts it in the row below when you double click the cell. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim lastrow As Long lastrow = Cells(Cells.Rows.Count...

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 MrExcel.com.
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 "mrexcel.com".
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
Back
Top