lastcolumn

  1. V

    VBA Excel cycle through sheets, find last row in table and autofill with data

    Hello All, I need a script that cycles through all the sheets in a workbook and adds 2 (or more) columns at the end of the table of each sheet (except the first sheet). In this case I have a YES and NO column to be added. The added columns YES and NO need to be autofilled all the way down to...
  2. V

    Copy Last column to Last row

    Hello, I am currently working on copying the data from excel table to paste in Outlook email, but my main problem is I wanted to copy the table dynamically because my last data in the table is dependent on what it needs to capture (For example the last column may be until to H, or until to K...
  3. P

    How to get the Last Column number which have data within a specific range ?

    I wanted to get Multiple Rows & Columns Data and stack it into single column in Excel. Below is the code i used : Sub SingleColumn() r = 3 lastrow = Cells(Rows.Count, "D").End(xlUp).Row For i = 1 To lastrow lastcol = Cells(i + 2, Columns.Count).End(xlToLeft).Column For j = 1 To...
  4. S

    Printing file name to last blank column before importing to new workbook

    Hello, I'm trying to import data from several workbooks into a single one, but I'm trying to print the file name on the first blank column for every row of data. I want to do this step on the original files before importing the data to the new workbook. The code that I have is able to paste...
  5. O

    Found last used column from Row 2, need value in row 1

    Hello all, I have been trying all afternoon to get something working and I can't figure out how to do this.... I am using the following to find the last used column in row 2 on my work sheet: LastColumn = Sheets("Summary").Cells(2...
  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. M

    Input username and date vba stamp help

    Hi, I have got a spreadsheet which has our daily figures into. This has been working ok in an older spreadsheet but we need to recreate the spreadsheet in Office 365 due to compatibility issues. I've recreated the spreadsheet in the same format however I'm getting an error when I input this...
  8. 9

    multiple charts - same worksheet - non contiguous cells - VBA code

    hi problem - I have found some code on the net that basically does what I want. I run the code and it loops through my data on sheet1 and outputs charts on sheet2. however the code gets the source data only from each row and does not allow for non contiguous data. my X axis data is always row...
  9. M

    Sorting attempt results in 400 error

    I am suddenly getting a 400 error while trying to sort data on a worksheet, and I can’t figure out why. Here’s my code: Dim SortRange As String Dim KeySortCol As String Dim LastColumn As String Dim LastRow as Integer ThisWorkbook.Sheets("Sheet 2").Activate LastColumn =...
  10. K

    Division of cells using cells(ij) format

    Hi everyone, I want to divide respective cells in one column with other column and obtaining the results in next column using cells reference. Here is VBA code i am using Range(Cells(3, lastcolumn + 6), Cells(5, lastcolumn + 6)).Formula = "=" & Cells(3, lastcolumn + 4) & "/" & Cells(3...
  11. K

    Hi

    Hi I want to divide respective cells in one column with other column and obtaining the results in next column using cells reference. Here is VBA code i am using Range(Cells(3, lastcolumn + 6), Cells(5, lastcolumn + 6)).Formula = "=" & Cells(3, lastcolumn + 4) & "/" & Cells(3, lastcolumn + 5) It...
  12. A

    Copy and Paste Values from 1 Worksheet to Another Based on Column Criteria

    Hello there !!!! I am new to excel and trying to do a pretty big project and I cannot figure out how to solve an error that keeps popping up. I have a weekly schedule which has 7 columns, each one for a day of the week. I am now trying to do a daily schedule which copies all the values from the...
  13. M

    Reflecting columns additions from one sheet on another sheet

    I have two sheets, A and B. Sheet A is a master list of people with data in each person's row corresponding to that person. I've written a userform that allows me to move people's row of data from A to B. We're still in the preliminary stages of our project, so columns are being added to A...
  14. S

    Looped ifs through multiple sheets (Nested loop?)

    Hi All, I'd be grateful of any help in getting a looped command working across multiple sheets. I think I'm close to getting this, but when I run the below it only performs the column hides on the last associated worksheet - it isn't applied to all worksheets (ignoring those excluded). Dim ws...
  15. H

    VBA puts formula into dynamic range

    Hi, I have no idea why this won't work. I get an application-defined/object-defined error. I have wsC defined earlier in the code. Range1/2/3 are Defined Name Ranges in the workbook. Any help is appreciated. Dim lastrow2, LastColumn As Long LastColumn = wsC.Cells(2...
  16. G

    Autofill Columns In Row1 According To Last Filled Column In Row2

    Hi I am looking for a macro that copies the formula in cell A1 and autofills row1 till the last filled column in row2. Sub AutofillColumnsInRow1AccordingToLastFilledColumnInRow2() Dim lastColumn As Long lastColumn = Range(Columns.Count & 2).End(xlToLeft).Column Range("A1").AutoFill...
  17. N

    Renaming the worksheet with the same file extension more than one time with macros?

    I have 4 Sheets where it must not be renamed/touched ... the name is ... "Menu" / "Original" / "Original (2)" / "UTP" I have to import multiple ".csv" worksheet and rename accordingly to identify them using the macro below This is my code to identify the sheets which is imported using the...
  18. C

    Run script from formula rather than manual cell entry

    Morning folks...well its morning here :) I have this code that was kindly produced for me on here. It does the following: Replaces all the formulas in a row with the value when the text and also replaces any blank cells with a dash (-) It does this whenever you manually enter the text...
  19. B

    R1CI Sum

    Good evening A bit stumped on how to sum a range utilizing R1C1. My code is: Thanks for any help. Sub sumeverycolum() Dim lastcolumn As Long Dim lcol As Long Dim lastrow As Long lastcolumn = Cells.Find(what:="*", after:=Range("A1"), _...
  20. K

    Autofill Formula Across Sheet to Final Column

    Hi there, I am creating a macro that requires a formula to be auto-filled across the spreadsheet to the last column with data in it. The number of columns varies. I have tried the following: Dim LastColumn As Long Range("Q3").Select ActiveCell.FormulaR1C1 =...

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