#vba

  1. C

    Copy and Paste a Range of Cells into the next blank row on another worksheet

    Hi there, I am trying to be able to copy a selected range which I have done below... Sheet2.Range("A2", Range("H2").End(xlDown)).Select Selection.copy However, I want to now copy this to the next blank row on another worksheet within the workbook. Can anybody help me try do this please. I did...
  2. H

    Copy data till the last row dynamically

    I am trying to copy data dynamically from Cell C1:G till the last row in any of the column in the Range. Attached is the snapshot in which the highlighted area is something I want to copy. Could any one please help me out? Sub TEST1_1() Dim lrc As Long lrc = Cells.Find(What:="*", _...
  3. H

    Copy data using advanced filter across all sheets.

    I am trying to create a macro which copies and pastes filtered data from all sheets of another workbook. The below code does the job but lacks accuracy in filtering data. Please note the database range is same across all sheets of another workbook (Headers on Row no.7) Accuracy Problem: It...
  4. H

    Advanced filter does not equal to a list of IDs from another workbook.

    Hi, I have a list of IDs from range A1, A2 and so on (Including Header in range A1) which I want the code to exclude while filtering the data from another workbook. My criteria range is B25:G26. I tried using <>*ID* by the pasting this in Range B26 (B25 as the header), which ran fine just for...
  5. H

    Copy data using advanced filter from another workbook.

    The below code tries to copy the filtered data from another workbook and pastes it into this workbook. Problem: Expected end of statement error is shown by highlighting the word ACTION. I have no clue why is this error appearing. Could anyone please help me? Sub Import_Data() Dim FileToOpen...
  6. M

    How to get a shape by its name through a variable

    Good afternoon, I am trying to create a macro, which copies the shapes that I've created on my worksheet and pastes them on a specific presentation. I see my idea very clear, but I can't get it working... All my shapes are named through typing the name at the up-left corner (as you could do to...
  7. H

    Debug wrong number of arguments or invalid property assignment error.

    I have 7 sheets in total and want to make save as for the first 5 sheets with time stamp and password. The below code gives an error msg "wrong number of arguments or invalid property assignment" highlighting the word FORMAT. This code used to work perfectly before adding the the 7th sheet...
  8. C

    Loop through xml files in a directory - working only on first file

    Hi, I created the below macro with the goal of updating in bulk (find/replace) some of the data inside multiple xml files saved in a folder. However, the below macro is only updating the first file saved in the folder and requires debugging on this line "Open sFileName For Input As iFileNum"...
  9. H

    Optimize loop with an if statement.

    About the code: It copies sheet7.RangeB11 till the last used column when the word MAPPED is found in sheet7.RangeA11 and so on; paste them in the said destination. Problem: I have large data set (around 2,00,000 lines) and this code consumes a lot of time when compared to the task implemented...
  10. Y

    color cells if two conditions met with vba

    Hi, basically I have this table range. I want to color the cells that are "0" but have length and serial number. but do nothing if don't have both conditions. i tried but it turns out all cells with "0" is colored even the conditions not met. I'm new with VBA. Still trying. glad if you could...
  11. H

    Copy data till the last row from one sheet and paste in the last column available of the another sheet.

    Expectation: I want to copy data from sheet7.Range G10 till the last row and paste in sheet4, Row No.10, last column available. Problem: The below code does not copy or paste (no error is shown by the debugger). I dont understand where I am going wrong. Could anyone please help me? Sub cf()...
  12. H

    Apply formatting to all sheets except the last sheet.

    Expectation: Apply formatting to all sheets in one go. Problem: The Below code applies borders to the active sheet only instead of all the sheets (Except DASHBOARD sheet). I dont understand where I am going wrong. Sub Format_all_sheets() Dim sht As Object Dim lcol, lrow As Long For Each...
  13. H

    Compare two data list in different sheets and copy the difference to another sheet.

    I want to check if the ID in sheet No.2, column B (Refer attached) is present in sheet No. 3, column B and copy the difference to sheet No.5, Range B11 along with NAME, COUNTRY, REGION & SECTOR. The below code only copies the ID to sheet No.5, Range B11. I want to edit the code that copies...
  14. Y

    how to delete the adjacent cells of the selected cells?

    Dear all expert, I am doing some macro vba to select a cells that contains specific text in a table. and I want to delete the adjacent cells cotents of the selected cells. I am new to vba and need your assistance. Thank you. On table 1 ,i have few "DONE" text. and I want delete the cells...
  15. K

    VBA to create Sequential number, depending on 3 items chosen from drop down list in Form

    Hello, I need help! I have created a UserForm to create a document number. The users choose 3 options - Project code, Discipline code, and Doc Type from drop downs. Depending on their choices, I need the next sequential number to populate in the Sequential Number text box on the form. On my...
  16. H

    Make save as when sheet name is based on cell value.

    I have total 6 sheets in my excel workbook from which I want to make a save as of first 5 sheets whose sheet names are based on cell value of sheet(6) E17,F17,G17,H17.I17 [Sheet Name is DASHBOARD]. So if the value in the cell changes the names of the sheets also changes. Please find below the...
  17. H

    Want to apply vba code to selected sheet in one go.

    The code dynamically hides rows & columns. I want to apply this code in one go to multiple sheets. Sheets Names are based on cell value which means if the value in the cell changes, sheet name also changes. I am new to VBA coding, would be thankful if anyone could help me out with this...
  18. H

    I want to hide Columns from the last used cell in Row NO. 10 till the end column.

    I want to hide Columns from the last used cell in Row NO. 10 till the end column. Sub Hide_Column_Rows() Dim LastRow, LastColumn As Long LastColumn = Cells("10", Columns.Count).End(xlToLeft).Column Range(LastColumn + 2 & ":XFD1048576").EntireColumn.Hidden = True LastRow = Cells(Rows.Count...
  19. B

    VBA copy filtered data with matching headers, go to sheet2, identify last row and paste each matching headers data in a new row below it

    Hi Guys, I am trying to copy filtered data with matching headers, go to sheet2, identify last row and paste each matching headers data in a new row below it, it doesn't work as expected. It copies all data and pastes it in order, does anyone know how to tweak the code to only paste matching...
  20. B

    VBA Can I consolidate all codes to do step by step after one button is used? Currently I have to use 4 buttons and it does not always work properly

    Hi, Can I consolidate all codes to do step by step after one button is used? Currently I have to use 4 buttons and it does not always work properly First button upload the CSV file from other source to "Source data" : Sub Load_Survey_Data1() Dim ws As Worksheet Dim filestring As String '...

Some videos you may like

This Week's Hot Topics

Top