Consulting

Results 1 to 3 of 3

Thread: Need an advice for Insert new Row in other Sheet in VBA

  1. #1

    Need an advice for Insert new Row in other Sheet in VBA

    HI everyone, i have 2 sheets that A and B.
    I got stuck on insert new row by code as below in other sheet in the same workbook.
      Rows(i).Select
      Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    So it works on A (which active sheet), but what i need is insert new row in B in case the active sheet is A.

    I tried to code like "Sheet(B).Select " or "With Sheets(B)" or samething like that, but fails.
    Can anyone help me this? Hope the help come soon!!! Thanks in advance!!!

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    Try the following instead
    Worksheets(Sheet B).Activate
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  3. #3
    Thank you, I solved by
     Sheets(B).Rows(i).Insert Shift:=xlDown

Posting Permissions

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