Results 1 to 10 of 27

Thread: Avinash Crap Pending sorting out

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #14
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0

    Avinash Crap Pending sorting out

    Code:
    Sub STEP7()
        Dim Wb1 As Workbook
        Dim wb3 As Workbook
        Dim Ws1 As Worksheet
        Dim ws3 As Worksheet
        Dim strPath As String
        Dim r As Long
        Dim m As Long
        Dim rng As Range
        Dim n As Long
        Application.ScreenUpdating = False
        Set Wb1 = Workbooks.Open(ThisWorkbook.Path & "\1.xls")
        Set Ws1 = Wb1.Worksheets(1)
        m = Ws1.Range("B" & Ws1.Rows.Count).End(xlUp).Row
        strPath = ThisWorkbook.Path & "\"
        Set wb3 = Workbooks.Open(strPath & "BasketOrder..csv")
        Set ws3 = wb3.Worksheets(1)
        Set rng = ws3.Range("C:C").Find(what:="*", searchorder:=xlByRows, SearchDirection:=xlPrevious)
        If rng Is Nothing Then
            n = 1
        Else
            n = rng.Row + 1
        End If
        For r = 2 To m
            ws3.Range("C" & n).Value = Ws1.Range("B" & r).Value
            n = n + 1
        Next r
        Application.DisplayAlerts = False
        wb3.SaveAs FileName:=strPath & "BasketOrder..csv", FileFormat:=xlCSV
        wb3.Close SaveChanges:=False
        Wb1.Close SaveChanges:=False
        Application.DisplayAlerts = True
        Application.ScreenUpdating = True
    End Sub

    I have this macro which is working perfect but i converted the basketorder..csv to basketorder.xlsx so i need the modification according to that
    plz see the sample file
    condition: Copy column B data of 1.xls and paste it to column C of basketorder.xlsx(exclude the header of column B of 1.xls and simply paste the rest data to column C of basketorder.xlsx )
    Attached Files Attached Files

Similar Threads

  1. Replies: 14
    Last Post: 07-26-2020, 01:55 PM
  2. Excel Sheet Correction
    By johnny03 in forum Excel Help
    Replies: 1
    Last Post: 12-19-2014, 07:27 AM

Tags for this Thread

Posting Permissions

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