Results 1 to 24 of 24

Add two more columns, modifying an existing VBA code help.

Threaded View

Anka Add two more columns,... 02-07-2013, 02:25 PM
zbor Re: Modify VBA code 02-07-2013, 04:11 PM
Anka Re: Modify VBA code 02-07-2013, 04:26 PM
Anka Re: Add two more columns,... 02-10-2013, 08:52 AM
Anka Re: Add two more columns,... 02-10-2013, 04:36 PM
protonLeah Re: Add two more columns,... 02-10-2013, 11:17 PM
Anka Re: Add two more columns,... 02-12-2013, 07:02 PM
zbor Re: Add two more columns,... 02-13-2013, 04:14 AM
Anka Re: Add two more columns,... 02-13-2013, 09:53 AM
zbor Re: Add two more columns,... 02-13-2013, 04:37 PM
Anka Re: Add two more columns,... 02-13-2013, 05:20 PM
Anka Re: Add two more columns,... 02-13-2013, 07:21 PM
zbor Re: Add two more columns,... 02-14-2013, 03:23 AM
Anka Re: Add two more columns,... 02-14-2013, 11:09 PM
zbor Re: Add two more columns,... 02-15-2013, 02:56 AM
Anka Re: Add two more columns,... 02-15-2013, 02:29 PM
zbor Re: Add two more columns,... 02-16-2013, 03:43 PM
Anka Re: Add two more columns,... 02-16-2013, 05:02 PM
zbor Re: Add two more columns,... 02-17-2013, 06:39 AM
Anka Re: Add two more columns,... 02-17-2013, 10:49 AM
Anka Re: Add two more columns,... 02-17-2013, 11:29 AM
Anka Re: Add two more columns,... 02-17-2013, 11:39 AM
zbor Re: Add two more columns,... 02-17-2013, 01:11 PM
Anka Re: Add two more columns,... 02-17-2013, 01:24 PM
  1. #1
    Forum Contributor Anka's Avatar
    Join Date
    08-25-2012
    Location
    Lisbon
    MS-Off Ver
    Excel 2016
    Posts
    174

    Add two more columns, modifying an existing VBA code help.

    Hi all.

    I want some help, to modify this VBA code. I want to copy additional columns Z and AA, the even numbered rows, starting with Z8.
    Thank you in advance.

    Sub test()
        Dim ws As Worksheet, i As Long, x As Range
        Application.ScreenUpdating = False
        With Sheets("CONTROL")
        .Select
            For Each ws In Worksheets(Array(2, 3, 4, 5, 6, 7))
                If ws.Name <> Me.Name Then
                    With ws.Range("b9").CurrentRegion
                        For i = 1 To .Rows.Count Step 2
                            If x Is Nothing Then
                                Set x = .Rows(i).EntireRow.Range("b1,g1:h1")
                            Else
                                Set x = Union(x, .Rows(i).EntireRow.Range("b1,g1:h1"))
                            End If
                        Next
                    End With
                    If Not x Is Nothing Then
                        .Range("b" & Rows.Count).End(xlUp)(2).Select
                        x.Copy
                        Me.Paste link:=True
                    End If
                    Set x = Nothing
                End If
            Next
            .[b3].Select
        End With
        With Application
            .CutCopyMode = False
            .ScreenUpdating = True
        End With
    End Sub
    Last edited by Anka; 02-07-2013 at 04:22 PM.
    Many thanks to all who have helped me.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1