Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Move copany 2 data to new sheet excel VBA

This is a discussion on Move copany 2 data to new sheet excel VBA within the Excel Questions forums, part of the Question Forums category; https://www.dropbox.com/s/hg2girtxr4...ting.xlsm?dl=0 Thx Originally Posted by Michael M In that case can you either post a small sample here using the ...

  1. #11
    New Member
    Join Date
    Dec 2014
    Posts
    29

    Default Re: Move copany 2 data to new sheet excel VBA

    https://www.dropbox.com/s/hg2girtxr4...ting.xlsm?dl=0

    Thx

    Quote Originally Posted by Michael M View Post
    In that case can you either post a small sample here using the HTML Maker in my tag
    OR
    Upload the worksheet to Dropbox and post the link back here !


    Also, are you placing the code in a standard module AND making the data sheet that needs to be copied the Activesheet ?

  2. #12
    Board Regular Michael M's Avatar
    Join Date
    Oct 2005
    Location
    Western NSW
    Posts
    15,269

    Default Re: Move copany 2 data to new sheet excel VBA

    Two things to fix...
    Put the code in a Standard module....not the Sheet module
    The Uppercase text in Cell C34 won't be recognised in the macro because there is a trailing space in the cell !
    Regards
    Michael M
    ---------------------------------------
    The more I learn, the less I seem to know.....A Please and Thank You cost nothing !
    It's easier to debug if we can see the whole macro !
    Home 2007 & 2013

    - Posting guidelines, forum rules and terms of use

    - To download Mr Excel HTML Maker

    - Try searching for your answer first, see how

    - Read the FAQs

    - List of BB codes


    [CODE]Place Your Code Here[/CODE]

  3. #13
    New Member
    Join Date
    Dec 2014
    Posts
    29

    Default Re: Move copany 2 data to new sheet excel VBA

    I am clicking the command button on ETL sheet. So the sheet reference is required...
    I fix the issue with space. But still not copying the data...


    Quote Originally Posted by Michael M View Post
    Two things to fix...
    Put the code in a Standard module....not the Sheet module
    The Uppercase text in Cell C34 won't be recognised in the macro because there is a trailing space in the cell !

  4. #14
    Board Regular Michael M's Avatar
    Join Date
    Oct 2005
    Location
    Western NSW
    Posts
    15,269

    Default Re: Move copany 2 data to new sheet excel VBA

    You also need to read here, as you are using ActiveX controls

    Office Update breaks ActiveX controls | Excel Matters
    Regards
    Michael M
    ---------------------------------------
    The more I learn, the less I seem to know.....A Please and Thank You cost nothing !
    It's easier to debug if we can see the whole macro !
    Home 2007 & 2013

    - Posting guidelines, forum rules and terms of use

    - To download Mr Excel HTML Maker

    - Try searching for your answer first, see how

    - Read the FAQs

    - List of BB codes


    [CODE]Place Your Code Here[/CODE]

  5. #15
    New Member
    Join Date
    Dec 2014
    Posts
    29

    Default Re: Move copany 2 data to new sheet excel VBA

    Yep.

    I use lot of active x control and I am aware of this. All of my other activex controls are working perfectly.

    Thx.
    Isu

    Quote Originally Posted by Michael M View Post
    You also need to read here, as you are using ActiveX controls

    Office Update breaks ActiveX controls | Excel Matters

  6. #16
    Board Regular Michael M's Avatar
    Join Date
    Oct 2005
    Location
    Western NSW
    Posts
    15,269

    Default Re: Move copany 2 data to new sheet excel VBA

    Ok, this is a bit desperate, but try
    Code:
    Private Sub CommandButton1_Click()
    '''to get rid of all the merge cells in the complete sheet
     'Sheets("ECA562 Aged Debt - Original").Select
     'ActiveSheet.Cells.Select
      '        With Selection
       '     .Orientation = 0
        '    .AddIndent = False
         '   .ShrinkToFit = False
          '  .ReadingOrder = xlContext
           ' .MergeCells = False
      '  End With
    Sheets("ECA562 Aged Debt - Original").Select
      Dim lr As Long, r As Long
      lr = Sheets("ECA562 Aged Debt - Original").Cells(Rows.Count, "C").End(xlUp).Row
    'lr = Cells(Rows.Count, "C").End(xlUp).Row
    For r = 2 To lr
        If Sheets("ECA562 Aged Debt - Original").Range("C" & r).Value = "ENERGY TELECOMMUNICATIONS PTY LTD" Then
            Sheets("ECA562 Aged Debt - Original").Rows(r & ":" & lr).Copy Destination:=Sheets("ECA562 - EETL").Range("A2")
            Exit Sub
        End If
    Next r
    End Sub
    Regards
    Michael M
    ---------------------------------------
    The more I learn, the less I seem to know.....A Please and Thank You cost nothing !
    It's easier to debug if we can see the whole macro !
    Home 2007 & 2013

    - Posting guidelines, forum rules and terms of use

    - To download Mr Excel HTML Maker

    - Try searching for your answer first, see how

    - Read the FAQs

    - List of BB codes


    [CODE]Place Your Code Here[/CODE]

  7. #17
    New Member
    Join Date
    Dec 2014
    Posts
    29

    Default Re: Move copany 2 data to new sheet excel VBA

    Finally Yes...


    Quote Originally Posted by Michael M View Post
    Ok, this is a bit desperate, but try
    Code:
    Private Sub CommandButton1_Click()
    '''to get rid of all the merge cells in the complete sheet
     'Sheets("ECA562 Aged Debt - Original").Select
     'ActiveSheet.Cells.Select
      '        With Selection
       '     .Orientation = 0
        '    .AddIndent = False
         '   .ShrinkToFit = False
          '  .ReadingOrder = xlContext
           ' .MergeCells = False
      '  End With
    Sheets("ECA562 Aged Debt - Original").Select
      Dim lr As Long, r As Long
      lr = Sheets("ECA562 Aged Debt - Original").Cells(Rows.Count, "C").End(xlUp).Row
    'lr = Cells(Rows.Count, "C").End(xlUp).Row
    For r = 2 To lr
        If Sheets("ECA562 Aged Debt - Original").Range("C" & r).Value = "ENERGY TELECOMMUNICATIONS PTY LTD" Then
            Sheets("ECA562 Aged Debt - Original").Rows(r & ":" & lr).Copy Destination:=Sheets("ECA562 - EETL").Range("A2")
            Exit Sub
        End If
    Next r
    End Sub

  8. #18
    Board Regular Michael M's Avatar
    Join Date
    Oct 2005
    Location
    Western NSW
    Posts
    15,269

    Default Re: Move copany 2 data to new sheet excel VBA

    ......
    Regards
    Michael M
    ---------------------------------------
    The more I learn, the less I seem to know.....A Please and Thank You cost nothing !
    It's easier to debug if we can see the whole macro !
    Home 2007 & 2013

    - Posting guidelines, forum rules and terms of use

    - To download Mr Excel HTML Maker

    - Try searching for your answer first, see how

    - Read the FAQs

    - List of BB codes


    [CODE]Place Your Code Here[/CODE]

  9. #19
    New Member
    Join Date
    Dec 2014
    Posts
    29

    Default Re: Move copany 2 data to new sheet excel VBA

    Thx a lot mate.

    Quote Originally Posted by Michael M View Post
    ......

Page 2 of 2 FirstFirst 12

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com