• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Recent content by GCExcel

  1. GCExcel

    How to convert na, NA, Na, or nA to N/A in columns E and F

    Hi, I think this should work: .Value = .Parent.Evaluate(Replace("IF(#=""NA"",""N/A"", UPPER(#))", "#", .Address))
  2. GCExcel

    Rearrange Sheets back and forth

    Hi nagovind, Why do you need to reorder the sheets? If it's because you don't want to "see" the "APsheets", you could hide them instead? (just trying to understand your use case as their might be an alternative solution). Otherwise, you could have a hidden sheet where you would store the...
  3. GCExcel

    loop works in module but not worksheet code

    My bad, I just saw the error, add a "." in front of Cells .Range(.Cells(x + 3, c), .Cells(256, c)).Copy
  4. GCExcel

    loop works in module but not worksheet code

    Can you share the rest of the code or even better your workbook?
  5. GCExcel

    Separate letters in columns

    Hi, Here's a suggestion for you : Sub Separar2() Dim g As Long Dim y As Integer, k As Integer Dim código As String Dim respuesta(1 To 100) g = Hoja1.Range("B" & Rows.Count).End(xlUp).Row Range("D" & g & ":" & "AZ" & g).Interior.Color = xlNone 'Separar los numeros en cada celda...
  6. GCExcel

    loop works in module but not worksheet code

    Hi, It's because you use Activesheet to refer to the sheet you want to apply the For/Next. Since the code is inside a sheetcode, the activesheet is always the same (ie that sheet code). When referring to a range or a cell, if is good practice to refer to the sheet name to prevent such problem...
  7. GCExcel

    Rearranging column of table to rows

    Hello, Here's a suggestion for you. Sub TransposeData() Dim ar Dim Dic, a, b, e Dim i As Long, str As String Set Dic = CreateObject("Scripting.dictionary") ar = Range("A4").CurrentRegion.Value 'Store values in array '/ Optional - to sort array on Status_Age ReDim...
  8. GCExcel

    Arrange Multiple rows into columns

    Hello, Add your sheet called "Output" in your Provider List file, then run this code : Sub CompileData() Dim Dict Dim ar, a, b, c Dim i As Long, j As Long Dim sFullName As String ar = Sheets("Data").Cells(1).CurrentRegion.Value Set Dict =...
  9. GCExcel

    macro code reqd

    Hi webmax Maybe like this? Sub autosum() Dim R As Long lrow = Range("B1").End(xlDown).Row Range("F1").End(xlDown).Offset(1).Formula = "=SUM(R[-" & (lrow - 1) & "]C:R[-1]C)" Range("B1").End(xlDown).Offset(1).Formula = "=SUM(R[-" & (lrow - 1) & "]C:R[-1]C)" End Sub
  10. GCExcel

    VBA to find the delivery against goods receipt

    Hello, Have a look at the attached file. Macro is called "Test" in the Module "M_Orders". I used a custom class to get the results...
  11. GCExcel

    better way of copy from one sheet and paste to another?

    @Oxidised You can go in the properties (shortcut = F4) and change the sheet codename to whatever you want. Example: Sheet1 >> shData and then in your code : Sub Sub CopyIt() shData.Cells(RowCustomer, CurrentCol).Copy shMailMerge.Cells(CurrentRow, ColCustomer).PasteSpecial xlPasteValues...
  12. GCExcel

    Faster code by looping

    @SirJB7 a) If you want to skip rows 15 and 19, I believe you need to use AND not OR. Try this simple code, and see by yourself : Sub test() Dim i As Integer 'Want to skip 5 and 9 'This works : For i = 1 To 10 If i <> 5 And i <> 9 Then Debug.Print i Next i...
  13. GCExcel

    Macro for transposing and re-arranging data set

    Hi, See suggestion in the attached file. I've used a custom class to handle all those data. Macro is in the module call "M_MailMerge". You will also need the 2 classes "cCustomer" and "cCustomers".
  14. GCExcel

    Faster code by looping

    Hi, Avoid using .Select to make your code run faster. And this should probably be an AND instead of an OR to skip rows 15 and 19 : Sub Goal_Seek() Dim i As Integer Dim x As Double x = 0 With Sheets("Prime Total Returns") For i = 10 To 21 If i <> 15 And i <>...
  15. GCExcel

    My Macros are stuck recording in R1C1 style

    Hi, to my knowledge, you can switch between absolute/relative reference only for the "selection" of cells. All formulas are recorded using the R1C1 style in VBA. If you want to see the formula in A1 style, type this command in the execution window : ? activecell.formula
Back
Top