Posts by haroon2015

    I am using below code to copy paste data in same workbook



    But it taking too much time


    Re: Copy and paste is very slow VBA


    KjBox
    in below code i am having same problem, will u look plz this one here or i start a new thread?


    Re: Copy and paste is very slow VBA


    @KjBox
    THANX A LOT


    I CHANGED THESE ONES


    Code
    [/I][COLOR=#417394]        End With[/COLOR][COLOR=#417394]        Exit Sub[/COLOR][COLOR=#417394]End With[/COLOR][COLOR=#417394]End If[/COLOR][COLOR=#417394]End Sub[/COLOR][I]


    NOW ITS WORKING PERFECTLY AS I WANTED[/I]

    Re: Copy and paste is very slow VBA


    giving an error 438
    object doesn't supoort property
    at below line

    Code
    [COLOR=#333333].Cells(.Rows.Count, 4).End(xlUp).Offset(1).Resize([/COLOR][COLOR=blue]UBound[/COLOR][COLOR=#333333](x1, 1)) = x1[/COLOR]

    hi,


    i am using this code to copy data and paste at other workbook,
    but it is very slow.
    need help


    Re: Edit each cells but only unique one using vba


    Hi, kjbox
    as u know my range is c10:c300, ok


    which cells i want to added using macro?

    Quote

    one by one, c10 to last added data


    in above under quote line means
    i add data to c10, then c11, then 12, then 13..........to 30
    now code only added cells c10 to c30


    if i have data in range c10:c50
    then edit only c10 to c50


    let me know if you want to know more about my requirement

    Re: Edit each cells but only unique one using vba


    Sub Haroon2015_RangeEditing()
    Dim rCell As Range, vAns As Variant
    Redim x(1 To 1)

    On Error Goto ErrHndlr 'check there is at least one cell in c10:c300 with a value
    [c10:c300].SpecialCells(2).Select
    For Each rCell In Selection
    If IsError(Application.Match(rCell, x, 0)) Then
    vAns = InputBox("Edit cell if wanted", "Edit cell ", rCell)
    Redim Preserve x(1 To UBound(x) + 1)
    x(UBound(x)) = rCell
    If Not vAns = "" Then rCell = vAns
    End If
    Next
    ErrHndlr:

    End Sub



    I AM USING THIS CODE

    hi, everyone
    i am using below code to edit every cell in range.("C10:C300"),
    but
    now its checking every cell and edit him,
    but
    i want it edit only unique data,
    for example -


    cell 10 have data = haroon, then edit it
    cell 11 have data = alan, then edit it
    cell 12 have data = haroon, the skip it




    thanx in advance

    Re: Userform find, edit and update data error


    here is right code to work Solved By :) Sixthsense :)


    Code
    Private Sub ComboBox1_Change()Dim v As Variant, r As Range, vValue As Variant, i As ByteSet r = Sheet4.Range("D61:D500")vValue = ComboBox1.ValueIf IsNumeric(vValue) Then vValue = CDbl(vValue)v = Application.Match(vValue, r, False)    If Not IsError(v) Then        TextBox1.Value = r.Cells(v).Offset(0, -1).Value        TextBox2.Value = r.Cells(v).Offset(0, -3).Value        TextBox3.Value = r.Cells(v).Offset(0, 0).Value        TextBox4.Value = r.Cells(v).Offset(0, 1).Value        TextBox5.Value = r.Cells(v).Offset(0, 2).Value        TextBox6.Value = r.Cells(v).Offset(0, 3).Value        'MsgBox "Now you can edit."    End IfEnd Sub


    Code
    Private Sub CommandButton2_Click()Dim v As Variant, r As Range, vValue As Variant, i As ByteSet r = Sheet4.Range("D61:D500")vValue = ComboBox1.ValueIf IsNumeric(vValue) Then vValue = CDbl(vValue)v = Application.Match(vValue, r, False)If IsNumeric(v) Then    With r.Cells(v)        .Offset(, -1).Value = TextBox1.Value        .Offset(, -3).Value = TextBox2.Value        .Offset(, 0).Value = TextBox3.Value        .Offset(, 1).Value = TextBox4.Value        .Offset(, 2).Value = TextBox5.Value        .Offset(, 3).Value = TextBox6.Value    End With             For i = 1 To 6        Controls("TextBox" & i).Value = ""    Next i        ComboBox1.Value = ""    'MsgBox "successful edited."End IfEnd Sub