lastcolumn

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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 =...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. 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...
  14. 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...
  15. 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...
  16. 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"), _...
  17. 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 =...
  18. M

    Challenging: VBA to Combine (1) Naming Ranges with Another Range's Values; (2) Row & Column Loops; (Finding Last Row/Column)

    I have a lot of ranges I need to name. I want to use VBA to name every range in a column by referencing another column that contains the range names to be used. For instance, I want to name cell E3 (which has a value of 1) with the name in cell A3 (JillJan). Then, name cell E4 (which has a...
  19. Y

    VBA: copy import file data below current data

    Hi guys, I am relatively new to VBA, and I am getting stuck with my code. What I want to achieve is to import a file on a daily basis and copy that data in another worksheet below the existing data. I keep getting the following error: "Runtime error: 1004. We can't copy because the Copy and...
  20. A

    autofill macro for column

    HI, i want to autofill my formula to the last column. here is my code Dim LastColumn As Long LastColumn = Cells(5, Columns.Count).End(xlToLeft).Column Selection.AutoFill Destination:=Range("B1:" & LastColumn & "1"), Type:=xlFillDefault I have suceed count the last column by variable...

Watch MrExcel Video

This Week's Hot Topics

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
Top