lastcol

  1. A

    Find last column used on 2 rows and swap rows

    Hi all, I have some imported data and rows 5 and 6 need swapping, the imported data can contain different amounts of data meaning that the number of columns used can be different. I have tried the following but can't seem to get it to work Sub Macro3() Dim LastCol As Long With...
  2. D

    Replace Cell Refs with variable names

    Hi all, I've composed this macro which does what I need; (finds last used column in row4 and drags the contents 1 column to the right). In this case, last used column= BA Sub newmonth_book() Sheets("Book").Select Range(Cells(4, 53), Cells(8, 53)).AutoFill Destination:=Range(Cells(4...
  3. D

    Autofill with Range Names

    I have a worksheet where I want to autofill the fields in rows 4 to 8from the last populated column, into the next column. Rows 4 to 8 will always be ‘fixed’. Currently, the last populated column is BA. I can establish the LastCol & NextCol variables but I can’t passthem to my AutoFill command...
  4. gheyman

    Copy Down to last Row

    How Do I get the formula to go down to the last Row? lastrow = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row lastcol = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByColumns).Column + 1 'after last populated col lastcol2 =...
  5. S

    Integer rounding issue in VBA

    Hi all I have come across a bit of a problem in my VBA coding which is throwing up a issue. I take out a rounding error in my code with this statement, with EntryList declared as an Integer EntryList = (LastCol - 10) / 2 so if LastCol is 71 then EntryList is set to 30 (ie 71-10 = 61 & 61 / 2...
  6. Y

    1004 error .advancedfilter

    Hi, I have a sheet, with a dataset which is 18 columns, however, further datasets of 18 columns are repeated throughout the sheet horizontally. I need to stack this data vertically. below is a crude example of the table i have and what i need to do is take all the data outside of columns a...
  7. F

    VBA: Copy A Formula into a Cell - then AutoFill a Range with the Formula Values

    VBA: Copy A Formula into a Cell - then AutoFill a Range with the Formula / Values - Scenario is as follows: Data in Sheet1 goes from ("B3: to Unknown Last Column & row 13") Find Last column in Sheet1 with data - put into LastCol RANK Sheet1 data IN Sheet2 (putting in same spot... what...
  8. J

    Newbie error 1004 Application-defined or object-defined error

    Hello, i'm completely new to VBA I receive the following error 1004 Application-defined or object-defined error. the following code is processing this error. What needs to be accomplished is that assumes that he is 100% minus the value in the previous cell is value in cell a b c d 50...
  9. J

    VBA Newbie

    Hello, i'm completely new to VBA I receive the following error 1004 Application-defined or object-defined error. the following code is processing this error. Cells(1, lastcol + 1) = "xxxxxx" Columns(lastcol + 1).NumberFormat = "0%" lastcol = .Cells(1...
  10. G

    Delete column after last cell with filled data in row

    Hi I am working round deleting all the columns following the last filled cell in row 1 I have the following code but I am stuck: Sub DeleteColumns() Dim LastCol As Range Dim LastColCellNumber As Long With ActiveSheet Set LastCol = .Cells(.Columns.Count, 1).End(xlToLeft)...
  11. A

    Object Required - Nested For Loop

    Hi Everyone, Can't seem to figure this one out, been picking my brain for a few hours.. I am getting object required for the x.EntireColumn.Delete portion. My guess is it's not carrying the x variable into the next for loop? Basically I'm trying to loop through every workbook in the folder...
  12. A

    XLSTART macro opens two ghost processes

    Sub col() ' col Macro ' ' With Selection.Font .ThemeColor = xlThemeColorDark1 .TintAndShade = 0 End With With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .Color = 5420131 .TintAndShade = 0...
  13. B

    Delete Columns

    Could someone explain why this coed to delete every other column does not work. Sub delete_every_other_column() lastcol = Cells(1, columns.Count).End(xlToLeft).Column For c = lastcol To 2 Step -2 Cells(1, c).EntireColumn.Delete Next c End Sub
  14. melodramatic

    VBA sort variable range - Run-time error '1004' : Method 'Range' of object'_Global' failed

    I am running a macro that pulls in a grouping of files, and then before sending it to a chart, make sure that all of the data is in timestamp order. At the top of the pull-in page, I've created cells that do a count of rows and columns (Cell "A1" is the last data row, Cell "A2" is the last...
  15. D

    VBA Creation of Pivot Cache, Pivot Table - Error 13 Type Mismatch

    I am trying to use VBA to automatically create a pivot table, and I am getting error 13. I have highlighted the specific line where it is occurring. Please help! Relevant info: My column headers start in row 9 of my data sheet There are ~60,000 lines of data with columns out to AJ Dim PSheet...

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