lcol

  1. P

    Inventory VBA

    Hello, I've received and modified a simple VBA from another excel and i was wondering if anyone could help me modify even more. The thing i need is that the range of this code would be across all documents worksheets. I1,I2,I3 stays in the first sheet. Date and Name in any other if I2 or I3...
  2. S

    Help to set lastrow, lastcolumn minnimum

    Hi all I want to set lastrow always "> 4" and lastcolumn always ">6". I have code belovew and work well but I thinks have a better way to do. Could you have any suggession to do? My code is: Sub clear()Dim lrow As Long, lcol As Long Application.ScreenUpdating = False With Sheets("result")...
  3. Z

    copy range to separate sheet

    I'm having an issue copying data to another sheet within the same workbook. in the code provided the program works fine. Sub dinocheck() Dim i As Integer Dim r2 As Integer Dim lastrowdl, lastrowc, lastrowh, lastrowo, lcol As Long lastrowdl = Sheets("dino list").Cells(Rows.Count...
  4. S

    Create Table VBA Not Working

    Hello I am trying to create a table via VBA. It works when I am on the worksheet that I want the table to be on, but this worksheet will be hidden so I need it to work by allowing me to identify the worksheet. I cannot figure out why I am getting a run-time error "the worksheet range for the...
  5. T

    Confirming multiple column titles are present

    I'm trying to check if certain column titles are present in a header row lcol = Sheets("UPDATE TOOL").Cells(Columns.Count).End(xlToLeft).Colum Set Rng = Sheets("UPDATE TOOL").Range("A1", Sheets("UPDATE TOOL").Cells(1, lcol)) If Not IsError(Application.Match("Last reissue date", Rng, 0))...
  6. Trevor3007

    black border

    hi, i have the following code:- Sub FormatRange() Application.ScreenUpdating = False Dim LastRow As Long LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row Dim lCol As Long lCol = ActiveSheet.UsedRange.Columns.Count With Range(Cells(1, 1)...
  7. S

    VBA - For Each...Next Statement not moving 1 column

    In the following code I am trying to use the For Each...Next statement to identify cells in a range that contain a particular string. Then I want to cut each entire column and move to Columns(1). There are usually at least 3 or 4 of these columns. At the moment the code is moving all columns...
  8. A

    Hide worksheets if a box is checked

    I have a worksheet that has a macro that list all of the active worksheets. Sub ListSheetsTab()'downloaded from www.contextures.com 'list all sheets in active workbook Dim wb As Workbook Dim ws As Worksheet Dim wsM As Worksheet Dim lColorC As Long 'cell color Dim lColorT As Long 'tab color Dim...
  9. A

    Excel VBA Code for data label position

    I have problem with the data label position in the following code. It works fine for updating chart and showing the data labels in the center but I want data labels on top of bars. The code gives me error "Method 'Position' of object 'DataLabels' failed" lcol = INV.Range("N" &...
  10. K

    VBA code for finding last empty cell (column) (but it ignores borders... i need it to see borders as possibly an empty cell)

    my code says to find the last empty cell (in a column) but i would like it to select that cell if its empty, but still has a border around it (or possibly it wont... point is, it shouldnt matter if it has a border or not, just that if it doesn;t contain a string, then it should select that cell...
  11. K

    Help tweaking this code from macro recorder so it works correctly with my code: (pretty simple stuff)

    the code simply needs to find the first empty cell in row 1 (starting with column H(8), and going over to the last column that has text in it, then plus 1 column), and then from that point select all the way down, and all the way to the right. Then clear all, then delete. I have it working...
  12. K

    "For Each Cell In Range(Cells(etc....)" wont work in userform...(?)

    This runs fine in module or worksheet I have... Dim lCol As Long Dim wt As Worksheet Set wt = Worksheets("Employee Training Matrix") lCol = ActiveSheet.UsedRange.Columns.Count With wt For Each Cell In Range(Cells(4, 7), Cells(4, lCol)) If Cell = "b" Then Columns(Cell.Column).Hidden = True...
  13. R

    VBA to select rows and columns for dynamic range

    Hello! I need to set a dynamic range for formatting a report. The number of rows and columns will change regularly, and not all of the rows will have data. I put this together based on research in this forum, but I'm getting a "Compile error: invalid or unqualified reference" on ".Cells"...
  14. M

    What does this vba mean????

    What does Dim DC() mean? I'm used to only seeing "Dim as" whatever. What does this code do? Dim DC() ReDim DC(LCol - 6) For i = 0 To LCol - 6 DC(i) = i + 6 Next
  15. G

    vba sum values in row for several rows

    Hi all, Addition has never been so frustrating. I have many, many rows of numbers across several columns. The number of columns and rows will both vary. Values will begin in column B in each row. Would like to avoid loops, too many rows. Dim lcol as Long Dim fcol as Long Dim rrow as Long...
  16. G

    vba looping through rows and columns using application worksheetfunction

    hi all, I'm trying to loop through several rows and columns using application.worksheetfunction.sumifs. Here is the segment I'm having trouble with: Dim lcol As Long Dim rrow as Long Dim SumRange As Range Dim Criteria1 As Range Dim Criteria2 As Range lcol = Cells(1...
  17. K

    help me understand why this bit of code works one way but not the other... (?)

    This is ok: Dim lCol As Long lCol = ActiveSheet.UsedRange.Columns.Count For Each Cell In Range(Cells(4, 6), Cells(4, lCol)).SpecialCells(xlCellTypeVisible) If Cell = "E" Then Call Macro2 Else CommandButton28.BackColor = &H8000000F Next End Sub But this is not, even though...
  18. K

    Help please with speeding up my VBA code :(

    Ok... so this code ran perfectly fine before i moved part of the code over to a separate module (prior to this all the code was on the main sheet.... except for some code that formatted it upon opening which is on the workbook part.) Here is the old code that ran normally and not slow at all...
  19. M

    Run time error Method Value of Object Range Failed -2147417848 (80010108)

    Hi All, I am having a weird problem that each time it prints the data - it gives the error message Run time error Method Value of Object Range Failed -2147417848 (80010108) When i debug it and and continue with the code by pressing F8 - It works fine and prints the data however it keeps...
  20. M

    Speed Code & amend to shorten/neaten code

    Hi All This code works fine - i think how can i amend this code to make it shorter/neater and speed it up All im doing with the code is seperating each line by a question (currently all questions are across) Hoping someone can help me Many thanks Sub transposeme() Dim RawDatash As...

Some videos you may like

This Week's Hot Topics

Top