+ Reply to Thread
Results 1 to 5 of 5

how to define this method or property in form

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-12-2010
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    134

    how to define this method or property in form

    hi
    this code giving error msg " Run time error 438 Object doesn't support this property or method can some one pl help ather than that it create the new sheet with name on combobox but it doesn't copy the WB1 sheet"01"

    Private Sub cmdOK_Click()
    Dim wks As Worksheet
        Dim WB1 As Workbook
        Dim WB2 As Workbook
        Dim WBDest As Workbook
        Dim i As Long
        Dim NSname As Worksheet
       
       Set WBDest = Workbooks("Month.xls")
      Set WB1 = Workbooks.Open("C:\Day Data\Check  Data.xls")
     
        If Not ComboBox1.ListIndex = -1 Then
            
            WBDest.Worksheets.Add.Name = ComboBox1.Value
            'Set wks = ActiveSheet
            WB1.Sheets("01").Range("A1:N25").Copy
            'ThisWorkbook.Worksheets("Main").Range("A1:K31").Copy
            WBDest.Worksheet.Range("A1:K31").Select
            Selection.PasteSpecial Paste:=xlPasteColumnWidths
            ActiveSheet.Paste
            ActiveSheet.Range("A3").Value = ComboBox1.Value
            Unload Me
        Else
            Unload Me
            MsgBox "Pick a sheet!", 0, vbNullString
        End If
    End Sub

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: how to define this method or property in form

    It is Hard to duplicate the problem without the workbook.....

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  3. #3
    Forum Contributor
    Join Date
    02-12-2010
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: how to define this method or property in form

    hi
    i am giving the credit for this code to this forum.in some anther thread they get their solution.and i am using their form which is very similar to my requirement. here is my thing
    i have two WB one is month.xls which update daily and at the end of the day i save the data in WB At C:\data\Daily Data.xls manual.instead of doing manually i try to learning some and by help from guru like u try to do some automation. to add button to copy the sheet and paste the data in new sheet in WB Daily Data here i atteching the WB which sheet "01" i want to copy the code work till creating new work sheet in WB and name as in combo box value bu it not copy the data.
    i hope u will help me
    thanks
    Attached Files Attached Files
    Last edited by jay11; 04-28-2010 at 04:05 PM.

  4. #4
    Forum Contributor
    Join Date
    02-12-2010
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: how to define this method or property in form

    hi
    bump any response greatly appreciated
    thanks

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: how to define this method or property in form

    Is there another workbook you want the information sent to?

+ Reply to Thread

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