excel-2010

Copy multiple rows from multiple workbooks to one master workbook

こ雲淡風輕ζ 提交于 2019-12-12 04:59:43
问题 I'm new to VBA and are trying to copy multiple rows from multiple workbooks to one master workbook. All workbooks have the same header and same number of colums but some have more rows. I would like a total of 6 workbooks (one worksheet per book) to be combined in the master workbook in one single worksheet, below eachother. Header: Row 1, Column A through M I would like to fill workbook "Daily trend 2013_MASTER_AR.xlsx" D4 through L4 all the way to D51 trough L51 to the master workbook

How to add single quote and comma to all values in a column?

天大地大妈咪最大 提交于 2019-12-12 04:45:28
问题 I have a column host with following values: server1.abc.com server2.abc.com server3 Now, I want each of these values to be single quotes and separated by comma. The output should be like as below: 'server1.abc.com','server2.abc.com','server3' Please let me know how this can be achieved using Excel. So far I am able to separate values using , with following code: Public Function MergeME(r As Range) As String MergeME = Join(Application.Transpose(r.Value), ",") End Function How can I add double

How to nest more IF conditions in excel when first condition becomes FALSE?

无人久伴 提交于 2019-12-12 04:31:13
问题 The excel not accepting the formula =IF(AND(Sheet1!BZ2<>"",Sheet1!CB2<>"",Sheet1!CD2<>"",Sheet1!CF2<>"",Sheet1!CH2<>"",Sheet1!CA2="",Sheet1!BC2="B"), IF(Sheet1!CA2="","",TODAY()-1), IF( IF(AND(Sheet1!BZ2<>"",Sheet1!CA2="",Sheet1!BC2="A"),IF(Sheet1!CA2="","",TODAY()-1), IF( IF(AND(OR(Sheet1!DB2="Completed - Knowledge Transfer"),AND(Sheet1!BC2<>"")),IF(Sheet1!CA2="","",TODAY()-1), IF(Sheet1!CA2="","",Sheet1!CA2) ) ) ) I am following the below syntax for IF . =IF (logical_test, [value_if_true],

Hiding autofilter arrows not working

我们两清 提交于 2019-12-12 04:25:08
问题 'data is filtered Sub Filtration(mainsheet As Worksheet, lastrow As Long) Application.ScreenUpdating = False With mainsheet 'filters .Range("$A$12:$J$" & lastrow).AutoFilter Field:=7, Criteria1:="TRUE" .Range("$A$12:$J$" & lastrow).AutoFilter Field:=10, Criteria1:="TRUE" HideAutoFilterDropdowns End With Application.ScreenUpdating = True End Sub Sub HideAutoFilterDropdowns() With Range("A12") .AutoFilter Field:=1, VisibleDropDown:=False .AutoFilter Field:=2, VisibleDropDown:=False .AutoFilter

VBA to delete multiple RangeNames for single Range

血红的双手。 提交于 2019-12-12 03:57:26
问题 I have searched for an answer for hours, and can't search anymore. Have Seen lots of discussions about deleting all range names from a workbook or a worksheet. However, I need to delete multiple Range Names from a single Range while leaving other Range Names for other ranges on the same sheet and/or within the same workbook alone. Might the code look something like this?: Sub Delete_My_Named_Ranges() Dim nName As Name Dim wbk As Workbook Dim Sht As Worksheet Dim rgNm As Range, aCell As Range

Excel 2010, vba copy row to another sheet exclude previously copied based on ID number

佐手、 提交于 2019-12-12 03:39:06
问题 I have an excel workbook with a requirement to take rows from one sheet and copy (append) to another sheet based on the value within a column. I can accomplish this using the code below, but obviously each time I run this code, it will append the same rows over again. i.e Sheet1 is constantly added to, sheet2 is an incremental log of all the rows in sheet1 that have a flag of Yes in column 13. Same columns on both sheets, column 1 is a unique ID. Is there a way I can add to this code in order

Excel VBA Export Multiple sheets to PDF

早过忘川 提交于 2019-12-12 03:28:43
问题 I have been trying to export a named range on multiple worksheets to a single pdf. Initially, it seemed to work fine, then I noticed the the selected range would change when loading the various sheets into an array. It is my understanding by using Selection.ExportAsFixedFormat this would export the selected cells only. Therefore, I have a macro to loop through the required sheets, select the various ranges need then create an array for all the sheets to allow exporting to a single pdf. Dim wb

In a subset of cells, determine if at least one corresponding cell matches a value

早过忘川 提交于 2019-12-12 03:05:02
问题 Given a table (spreadsheet) of two columns, for a subset of cells in column A that meet a particular criterion, determine if at least one of the corresponding cells in column B meet some other criterion. For example, given the following data: A B 1 DR * 2 DR & 3 SR & 4 DR * 5 SR # 6 SR # I would like to know, for the subset of cells in column A that contain "DR", if there is at least one corresponding cell in column B that contains a "*". So, then, for "DR" the answer is true, but for "SR"

Excel Macro: Open Sheet in Background and Execute Analysis in Background Sheet

给你一囗甜甜゛ 提交于 2019-12-12 02:54:35
问题 I am relatively new to the true power in Excel - Macros/VBA and have been tasked to set up the financial model for a million dollar project. I am able to set everything up and have it run smoothly, but there's too much manual input involved. I would like to seek simplification through the power of VBA. This is my dilemma: I need to be able to individually double-click on a specific set of cells (in a Row), which will open up a file window that allows me to select a EXL file. Once I select the

VBA Loop through files in folder and copy/paste to master file

寵の児 提交于 2019-12-12 02:35:20
问题 I'm working on a project that has 3 files in a folder and one master template. Here is what I want to do: Automatically loop through these files then copy the content and paste it to master file. Each WHOLE file will be pasted to a new worksheet in the master file. The new worksheet's name will be the same as file's name. I tried to write some codes but I'm not experienced on VBA. The codes below are not working properly and missing functions 2 and 3. Please help! Sub AllFiles() Application