Consulting

Results 1 to 6 of 6

Thread: Copy text to cell from another sheet

  1. #1

    Copy text to cell from another sheet

    Hi EveryOne,

    I need a macro coding, Can any body help me for the below requirement.

    If i mention AAAA in Sheet2 Cell A2, same should be pick in Sheet1 Cell A2

    Regards,
    Anantha Krishna

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I don't understand the problem
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    Hi Sam,Thanks for your response.

    i need as per below example
    in Sheet2
    ColumnA, ColumnB, ColumnC
    France, Jan, Monday
    USA. Feb. Tuesday
    UK, Mar, Wednesday

    in Sheet1
    ColumnD, ColumnE
    France, Jan Monday
    USA, Feb Tuesday
    UK, Mar Wednesday

    Regards,
    Anantha Krishna
    Last edited by krishak77; 03-31-2018 at 11:57 AM. Reason: Wrong Format

  4. #4
    Assumes that you have headers in both sheets.
    Sub Maybe()
    Dim lr As Long, i As Long, a
    lr = Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row
    a = Sheets("Sheet2").Range("A2:C" & lr).Value
        For i = LBound(a) To UBound(a)
            With Sheets("Sheet1").Cells(i + 1, 4)
                .Value = a(i, 1)
                .Offset(, 1).Value = a(i, 2) & " " & a(i, 3)
            End With
        Next i
    End Sub

  5. #5
    Hi Jolivanes,

    Thanks for your reply, it is exactly what i need, but is it possible to appear data in Sheet1 without click on run macro.

    Regards,
    Anantha Krishna

  6. #6
    VBAX Expert
    Joined
    Sep 2016
    Posts
    788
    Location
    Why don't you use formula?

    D1:=IF(Sheet2!A1="","",Sheet2!A1)
    E1:=IF(Sheet2!A1="","",Sheet2!B1& " " & Sheet2!C1)

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
  •