visual-studio-macros

Excel & VBA: Copy rows into a new sheet based on cell value

一世执手 提交于 2019-12-02 13:36:49
I'm a total newbie in Excel and VBA. I have a sheet like this: A B C D someinfo someinfo someinfo OK someinfo someinfo someinfo OK someinfo someinfo someinfo ERROR someinfo someinfo someinfo ERROR someinfo someinfo someinfo OK someinfo someinfo someinfo OK someinfo someinfo someinfo ERROR someinfo someinfo someinfo ERROR Ok I'd like to copy the "OK" lines into a new sheet and the one with "ERROR" into another one. How can I do that? As stated in earlier comments this is how you would Filter~>Copy~>Paste Sub FilterAndCopy() Application.ScreenUpdating = False Application.EnableEvents = False

Clean up unwanted code C#

好久不见. 提交于 2019-11-30 20:27:20
I got a C# application with Visual Studio 2005. The code has some 300 KLOC, which has been abused over 3 years. When I was going through code found out that lot of unused functions/methods/properties. Its not possible to clean the code manually (Requires checking each member and if found no references delete it.) I am looking to automate this process, by VS macro, which will walk through each member in code, if it does not have any references it should delete it, if found any references, check its calling member's references if calling member, does not have any reference it should delete both

How to get specific version of folder from tfs without creating a workspace?

感情迁移 提交于 2019-11-30 05:06:10
I would like to get the source code of a project at specific time (changeset). So I need do download whole folder. I would like to do it for different times and handling a different workspace is not very convenient. I know about TFS Get Specific Version into separate folder (with workspace) and Need command to get a file from TFS without a workspace (one file). Is there some solution for whole folder without creating a new workspace? Edit I have found the accepted answer too ambitious. I needed something more simple. Assumptions: I can access TFS from Visual Studio on my computer I want to get

Clean up unwanted code C#

百般思念 提交于 2019-11-30 04:59:48
问题 I got a C# application with Visual Studio 2005. The code has some 300 KLOC, which has been abused over 3 years. When I was going through code found out that lot of unused functions/methods/properties. Its not possible to clean the code manually (Requires checking each member and if found no references delete it.) I am looking to automate this process, by VS macro, which will walk through each member in code, if it does not have any references it should delete it, if found any references,

How to get specific version of folder from tfs without creating a workspace?

烈酒焚心 提交于 2019-11-29 02:52:16
问题 I would like to get the source code of a project at specific time (changeset). So I need do download whole folder. I would like to do it for different times and handling a different workspace is not very convenient. I know about TFS Get Specific Version into separate folder (with workspace) and Need command to get a file from TFS without a workspace (one file). Is there some solution for whole folder without creating a new workspace? Edit I have found the accepted answer too ambitious. I

Excel VBA range.find acting up

佐手、 提交于 2019-11-28 12:54:46
Im trying to use range.find to look up a value within a column, and return the matching value from the next column. I recorded the find() using the macro recorder, which seemed to work fine for a while, but for some reason it's now giving me an error. As far as I can tell I haven't changed anything that should affect this bit of code. This is what I have Public Function look_up_id(id, table) Worksheets(table).Activate Cells.Find(What:=id, After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False).Activate

Visual Studio macro: Find files that aren't included in the project?

佐手、 提交于 2019-11-27 14:10:12
I'd like to write a macro to crawl through the files in my project directory and find files that aren't included in the project. In playing around with the DTE object, I see that the Project object has ProjectItems ; if a ProjectItem represents a directory, then it has its own ProjectItems collection. This gives me all files that are included in the project. So I could crawl recursively through each ProjectItems collection, and for each ProjectItem that's a directory, check to see if there are files in the file system that don't have a corresponding ProjectItem. This seems clumsy, though. Any

Awesome Visual Studio Macros [closed]

孤街醉人 提交于 2019-11-27 05:51:46
For a small community discussion, what are some essential Visual Studio macros you use? I just started learning about them, and want to hear what some of you can't live without. I used to employ a lot of macros in VS 2002/2003. One example would be Region creation - I always like my classes to be divided into the following regions - "Private members", "Public Properties", "Public Methods" and "Private methods". So, I have a macro mapped to a shortcut key that creates these regions in any new class file. Refactoring support in VS 2005/2008 (and the facility of adding common code snippets) as

How to Use/Enable (RegExp object) Regular Expression using VBA (MACRO) in word

和自甴很熟 提交于 2019-11-27 01:52:17
I did lot of Googling to get a proper answer on how to use or start using Regular Expressions in VBA. At last I got it so I'd like to share my knowledge with you guys. Please correct me if I am wrong. HateStackOverFlow By default Regular Expression option is disabled in word 2007, to enable that plase do following steps, 1). Go to Tools > References as shown below. 2). Now put a tick on "Microsoft VBScript Regular Expressions 5.5" option and then press oh as shown below. 3). Now onward you can create a RegExp object in your VBA script. You can verify it be searching in object data base as

Alternative to macros in Visual Studio 2012

坚强是说给别人听的谎言 提交于 2019-11-26 15:08:22
I use macros extensively for ViewModel properties in XAML development. I use them even more in WCF to generate Message and DataContract properties. To my disappointment, the macros I've built aren't going to be usable in Visual Studio 2012. An example of what I'm talking about, for a VM, I would enter something like this. int id; string name; Select both lines, run a macro and end up with private int _id; private string _name; public int Id { get {return _id;} set { if(_id != value) { _id = value; RaisePropertyChanged("Id"); } } public string Name { if(_name != value) { _name = value;