excel-vba

VBA Conditional Formatting

孤者浪人 提交于 2020-01-06 19:41:55
问题 I am struggling to figure out an elegant way to apply conditional formatting rules via VBA. I prefer VBA because a) the rules will apply to multiple worksheets, and b) it prevents the CF duplication problem when copying/pasting between worksheets. I have a list of inventory items, all kept in different locations. I want to format based on location with the following formatting: Font color (will change for each location); Top border (same color as font); Bottom border (same color as font) Also

How to transpose one or more column pairs to the matching record in Excel?

淺唱寂寞╮ 提交于 2020-01-06 19:40:36
问题 Given data sets like this: Sheet 1 Col1 Col2 Col3 Miss Molly Extra Data Extra Data Mister Rogers Extra Data Extra Data Roy Rogers Extra Data Extra Data and Sheet 2 Col1 Col2 Col3 Miss Molly Value Name 1 Value Data 1 Miss Molly Value Name 2 Value Data 2 Mister Rogers Value Name 1 Value Data 1 Roy Rogers Value Name 1 Value Data 1 Roy Rogers Value Name 2 Value Data 2 Roy Rogers Value Name 3 Value Data 3 How can I end up with a transposed output like this? Sheet X (you can make me a new sheet if

Microsoft Excel 2003 - copying out-of-order descriptions

此生再无相见时 提交于 2020-01-06 19:38:48
问题 I have done a thorough search but cannot find an answer for my specific issue, using Microsoft Excel 2003. I need to copy Column R descriptions (alphanumerical) from one xls spreadsheet (let's call it ssA) to columns L & M in another spreadsheet (ssB), by svc_itm_cde (service item code). There are about 300 svc_itm_cdes. Three complications: The svc_itm_cde column in ssA is not in the same order as the one in ssB. Some of the rows of L & M in the ssB already contain descriptions and must be

how to add some lookup data while merging multiple workbooks into one

醉酒当歌 提交于 2020-01-06 19:38:08
问题 I have a program now which merges a particular worksheet from multiple workbooks. This program has to process around 300 workbooks and create a consolidated workbook. In the consolidated workbook, I have to add a few more data points to each of the rows copied from other workbooks. The number of rows in the target workbook is likely be around 100,000. I have another XL which contains many other data related to a customer like the name, country, currency, etc which I have to add as other

Vba macro excel: How to hide rows if cell equal FALSE

£可爱£侵袭症+ 提交于 2020-01-06 19:37:40
问题 I have a project which requires Excel to hide rows on a separate sheet(within the same workbook) after user selects specific options on the activesheet. The macro is linked to a button, when clicked rows will be hidden on the separate sheet, and the whole process occurs in the background. If the user want to check the table with hidden rows they'd need to navigate to that separate sheet to see the result. Image explanation: http://postimg.org/image/ek6981vg1/ Worksheets("Input- Select Pens")

Vba macro excel: How to hide rows if cell equal FALSE

佐手、 提交于 2020-01-06 19:36:54
问题 I have a project which requires Excel to hide rows on a separate sheet(within the same workbook) after user selects specific options on the activesheet. The macro is linked to a button, when clicked rows will be hidden on the separate sheet, and the whole process occurs in the background. If the user want to check the table with hidden rows they'd need to navigate to that separate sheet to see the result. Image explanation: http://postimg.org/image/ek6981vg1/ Worksheets("Input- Select Pens")

Using InputBox to return user input as a text string as a variable in a formula

烈酒焚心 提交于 2020-01-06 19:26:45
问题 I would like to take user input and insert it in a formula. The input box would have a field for account name, month, type. This variable would need to be returned in the sumifs formula saying sumifs , column E is this account column c is this month and column d is this type. I've looked but all I find involve numbers inputs much less returning the text string as a variable in a sumifs formula. Formula Ex: =SUMIFS(E2:E100, A2:A100, "Account Name",C2:C100,"Month",D2:D100,"Type") 回答1: You will

VBA code to delete a row based on a non empty cell in a column

好久不见. 提交于 2020-01-06 18:11:06
问题 I am running a report of employees who charge time to different codes. The report gives me the following columns: Emp# / Emp Name / Rate / TermDate If the employee has left, then there is a value in the TermDate column. Because the value in the cell could be any date, I want to write a macro that will search the list and delete any row in which the value in the fourth column is NOT blank. I've found several examples of how to delete a row based on blank cells, or based on certain values, but

Save a worksheet with form Save As location in Excel VBA

两盒软妹~` 提交于 2020-01-06 18:10:11
问题 Well, I am not a developer but an regular an Excel user try to automate some process while working so please understand if my question is of simple to do. I just want to a macro that can when I run the macro, it will allow me to Browse the computer so I can save the file in the direction and file name I like If possible Default location is the location of the workbook, just to save time Thank you 回答1: Try below code : Sub SaveAsDailog() Application.DisplayAlerts = False Dim filePath As

sorting across sheets in excel

戏子无情 提交于 2020-01-06 16:28:53
问题 I don't know if this is possible or not. I have a workbook that has two sheets, "input" and "output" user1 fills in the "input sheet" Column A = name Column B = Age Column C = Location Column D = Hight .. .. Then on the "output" sheet Column A is set to copy the value from Column A on the "input" sheet and User2 fills in more details using the values that user1 has entered Column B = eye colour Column C = hair colour Column D = number of fingers .. .. So I hope you get the idea, User1 enters