excel

VBA Excel Replace last 2 digits of number if occurs at beginning of string

守給你的承諾、 提交于 2021-02-10 05:14:13
问题 I'm trying to replace the last two digits of number with " XX BLOCK " if it occurs at the start of the string and has more than 2 digits. I'm using the Microsoft VBScript Regular Expressions 5.5 reference. Dim regEx As New RegExp With regEx .Global = True 'Matches whole string, not just first occurrence .IgnoreCase = True 'Matches upper or lowercase .MultiLine = True 'Checks each line in case cell has multiple lines .pattern = "^(\d{2,})" 'Checks beginning of string for at least 2 digits End

Mac Excel 2016 VBA - Workbook.open gives 1004 error

穿精又带淫゛_ 提交于 2021-02-10 05:12:55
问题 I'm trying to get a macro that works perfectly in Excel 2011 for Mac to work in Excel 2016 for mac. The goal is to have the user specify a folder with .csv files in it, and then the macro loops through all the .csvs, opening each to copy information out of it into another Workbook. The macro fails when trying to open the first .csv file in the user-chosen folder, with a 1004 error, file cannot be found. (side note: Earlier in the macro, workbooks.open works perfectly with a user selected FILE

Mac Excel 2016 VBA - Workbook.open gives 1004 error

旧巷老猫 提交于 2021-02-10 05:12:48
问题 I'm trying to get a macro that works perfectly in Excel 2011 for Mac to work in Excel 2016 for mac. The goal is to have the user specify a folder with .csv files in it, and then the macro loops through all the .csvs, opening each to copy information out of it into another Workbook. The macro fails when trying to open the first .csv file in the user-chosen folder, with a 1004 error, file cannot be found. (side note: Earlier in the macro, workbooks.open works perfectly with a user selected FILE

Protecting and Hiding Columns same as “Very Hidden” Sheets

谁说胖子不能爱 提交于 2021-02-10 05:00:52
问题 I am trying to hide some columns and prevent the user to have any access to them; while they can edit other parts of the sheet. What I am seeking is something like: ActiveWorkbook.Sheets("Name").Visible = xlSheetVeryHidden So user cannot see them. I am aware that one option is adding another sheet and move those columns to there and hide that one sheet; but as I am working on a relatively large data-set and it has a standard format within the company, I prefer not to do so. I already tried

Protecting and Hiding Columns same as “Very Hidden” Sheets

淺唱寂寞╮ 提交于 2021-02-10 04:59:46
问题 I am trying to hide some columns and prevent the user to have any access to them; while they can edit other parts of the sheet. What I am seeking is something like: ActiveWorkbook.Sheets("Name").Visible = xlSheetVeryHidden So user cannot see them. I am aware that one option is adding another sheet and move those columns to there and hide that one sheet; but as I am working on a relatively large data-set and it has a standard format within the company, I prefer not to do so. I already tried

Protecting and Hiding Columns same as “Very Hidden” Sheets

梦想与她 提交于 2021-02-10 04:59:27
问题 I am trying to hide some columns and prevent the user to have any access to them; while they can edit other parts of the sheet. What I am seeking is something like: ActiveWorkbook.Sheets("Name").Visible = xlSheetVeryHidden So user cannot see them. I am aware that one option is adding another sheet and move those columns to there and hide that one sheet; but as I am working on a relatively large data-set and it has a standard format within the company, I prefer not to do so. I already tried

VBA To Add Formula To Cell

梦想的初衷 提交于 2021-02-10 04:56:13
问题 I am attempting to write some VBA which will add header text to 3 cells then fill a formula all the way down to the last row. I have written the below, which writes the headers no problems, but when it get's to my first .Formula it throws a Application Defined or Object Defined error What needs to be altered so that this macro will execute successfully? (The formulas were pulled directly from the formula in the cell, so I know they are valid formulas at least on the "front-end") Function Gre(

VBA Sort by selected by user range

一世执手 提交于 2021-02-10 04:16:47
问题 I've been struggling with this issue in the past 3 days, so please help... What I want to do is to when I run a macro1 (for the sake of the argument): Window would pop up to select a range of which cells should be sorted Have these sorted via last column selected (or the 5th) (lowest to highest numbers) The issue here is that selected area would change eveytime (I create something like a tree in excel), so it cannot be a specific column that needs to be sorted by the last one (or the 5th in

VBA Sort by selected by user range

巧了我就是萌 提交于 2021-02-10 04:14:32
问题 I've been struggling with this issue in the past 3 days, so please help... What I want to do is to when I run a macro1 (for the sake of the argument): Window would pop up to select a range of which cells should be sorted Have these sorted via last column selected (or the 5th) (lowest to highest numbers) The issue here is that selected area would change eveytime (I create something like a tree in excel), so it cannot be a specific column that needs to be sorted by the last one (or the 5th in

VBA Sort by selected by user range

余生长醉 提交于 2021-02-10 04:14:18
问题 I've been struggling with this issue in the past 3 days, so please help... What I want to do is to when I run a macro1 (for the sake of the argument): Window would pop up to select a range of which cells should be sorted Have these sorted via last column selected (or the 5th) (lowest to highest numbers) The issue here is that selected area would change eveytime (I create something like a tree in excel), so it cannot be a specific column that needs to be sorted by the last one (or the 5th in