Tag Info

New answers tagged

1

Some trying and failing brougt me to this sub, of which you can just paste the relevant bits into your own. As you can see I have used Chr(34) instead of double quotes to construct the string, because I think that increases readability, that is a personal preference though. Further, you'll notice that I stored the string in a variable, which is not strictly ...


0

Although your question doesn't receive a lot of applause (ugh!), I made a quick solution in Excel, where you don't need VBA. Copy-paste D3:F3 down as far as needed.


1

Try this: Sub CopyUnique() Dim s1 As Worksheet, s2 As Worksheet Set s1 = Sheets("Main") Set s2 = Sheets("Count") s1.Range("B:B").Copy s2.Range("A1") s2.Range("A:A").RemoveDuplicates Columns:=1, Header:=xlNo End Sub


0

Even though the macro recorder can get you the code to change the font color, you will need to edit the code to work for you. For this example I just used either vbBlack or vbRed as the font color. We can use an IIF statement to determine what the font color should be, so if the font color is vbBlack then change it to vbRed or else change it to vbBlack ...


0

"I have over written my Ctrl+V function with a macro - how do I restore the original back again?" One of the following will resolve your issue: Delete the macro Change the macro shortcut to something other than ctrl+v


3

I'm going to assume the rest of your code is done and what you need is some method to get a row for inserting your values. Here's a snippet that works best if your data isn't very large and you happen to prefer loops: Dim rNext as Long rNext = 2 'First used row in column F Do Until LenB(Range("F" & rNext).Value) = 0 rNext = rNext + 1 If rNext ...


0

This can occur due to corruption in a personal macro workbook (%appData%\Microsoft\Excel\XLSTART\), and removing PERSONAL.XLSB from this folder caused the problem to go away. I had to export each of my macro modules to another folder, then after removing PERSONAL.XLSB, record a new macro stored in my "Personal Macro Workbook" (which recreated ...


0

Figured this out. I'm sure other people are going to read this as I did today. You'll need two modules (one to extract hyperlinks and one to test file path directory) Module1 (for hyperlinks) Function HLink(rng As Range) As String 'extract URL from hyperlink 'posted by C.F. Stotch! - shoutout to Richard K! If rng(1).Hyperlinks.Count ...


0

You don't show what you want for results. But it sounds like you want to produce a table which combines the duplicates in your original list. I would define a class, and use the collection object to test for duplicates and combine. The collection object is handy for this as it will return an error if you try to add an object with a pre-existing key. The ...


1

And if you really want a macro, use this (taken mostly from here, with some improvements): Option Explicit Sub AutoSum() Const SourceRange = "C:F" Dim NumRange As Range, formulaCell As Range Dim SumAddr As String Dim c As Long For Each NumRange In Columns(SourceRange).SpecialCells(xlConstants, xlNumbers).Areas SumAddr = ...


0

Instead of a macro, it seems to me that what you ask is already part of Excel as a feature, called AutoSum. Just place the cursor under a contiguous set of numbers (a region, in Excel-speak), and press the AutoSum button. Excel will come up with the formula for you. The AutoSum button is on the ribbon, on the "Home" tab, far to the right, and has an icon ...


0

I was having a similar problem. The reason the formulas were pasted with the link to WBA was that the tab (sheet) I was working on in WBA was named differently from that in WBB. For me, it was always "the last sheet" but one was named 'MinFlow' and the other was named 'NormalFlow'. I renamed both to 'Results' and the copy/paste worked as I wanted it to - a ...


1

I cannot reproduce the problem, not with the latest 7.4.608, nor with 7.4, or 7.0. I think you have custom syntax extensions that cause this. Try with $ vim -N -u NONE; the problem probably is gone then. You should then check your syntax extensions (~/.vim/after/syntax/cpp.vim, ~/.vim/syntax/cpp/*.vim, etc.). You need to find out which syntax group causes ...


0

(CharlieRB's answer is included here as he posted the answer 1.3 years before me) The piece you're still missing is splitting multiple red phrases from the same cell into multiple entries in your list. That is because you don't put the phrase in your list until you go through all the text in the cell. You need to have an escape built in the FOR loop to store ...


1

I'm not a VBScript user, so can't give you chapter and verse on how to acquire and automate a PowerPoint object using it, but once you've done so, the PPT object has an Application.Run method. Here's a quickie example that I cobbled up based on a google search. It works here: Save this as a VBS file: Set oApp = CreateObject("Powerpoint.Application") ...


1

Allow run script at powershell, type at cmd run as Administrator: Select pin cmd press Shift+Right mouse Click powershell -command "Set-ExecutionPolicy RemoteSigned" Create folder PdfConvert at Desktop, Run Pdf2Docx4.cmd Convert all pdf file at folder $PDFpath :) to docx. Pdf2Docx4.cmd: powershell .\PdfConvert\Pdf2Docx4.ps1 ...


1

This VBa does what I think you want... Your question isn't the clearest. Remember, with VBa, create a copy of the file first as it has no undo feature Option Explicit Sub FindYeTheMapOfTreasure() Worksheets("Sheet2").Range("A:F").Clear Worksheets("Sheet2").Range("A:B").Value = Worksheets("Sheet1").Range("A:B").Value Dim row As Integer row = 2 ...


0

This is pretty simple, use a for loop with an if condition like this - Sub test() For Each c In Range("A:A") If c <> 0 And c.Offset(, 1) <> 0 Then c.Value = 1 End If Next End Sub You can change the range to fit your data, or you can try to get the usedrange. I don't quite understand your second part.



Top 50 recent answers are included