How do i copy my friendlist to a new main yahooaccount?

Conditional copy 2 data from different cell

  • QUESTION: i need a macro copy 2 data from different cell in same sheet and paste in different place. example, step 1 macro will copy data if "A1" is "copythis" copy "B1" from "sheet1" and paste in "B2" on "sheet2" step 2 macro will copy data if "A2" is "copythis" copy "B2" from "sheet1" and paste in "B2" on" sheet3" step1 must completed before step2,step2 may not run if "A2" not "copythis" ANSWER: ck, I assume you will run this macro; i.e. You don't want it to be an event macro. Sub copydata() Dim sh1 as worksheet, sh2 as worksheet Dim sh3 as worksheet set sh1 = worksheets("Sheet1") set sh2 = Worksheets("Sheet2") set sh3 = Worksheets("Sheet3") 'Step 1 if sh1.Range("A1").value = "copythis" then sh1.Range("B1").copy sh2.Range("B2") 'Step 2 - not done unless Step 1 is done if sh1.Range("A2").value = "copythis" then sh1.Range("B2").Copy sh3.Range("B2") end if End if End Sub Sorry for the late response - I was sleeping. ---------- FOLLOW-UP ---------- QUESTION: it is okay for me,and sorry for i was made a mistake in question. i need both steps copy and then paste in "same row with moving column" in different sheet. in other words, step 1 macro will copy data if "A1" is "copythis" copy "B1" from "sheet1" and paste in "B2,C2,D2,so on" on "sheet2" step 2 macro will copy data if "A2" is "copythis" copy "B2" from "sheet1" and paste in "B2,C2,D2,so on" on" sheet3"

  • Answer:

    ck, Sub copydata() Dim sh1 as worksheet, sh2 as worksheet Dim sh3 as worksheet, i as long set sh1 = worksheets("Sheet1") set sh2 = Worksheets("Sheet2") set sh3 = Worksheets("Sheet3") 'Step 1 if sh1.Range("A1").value = "copythis" then i = sh2.cells(2,sh2.columns.count).End(xltoLeft).column + 1 sh1.Range("B1").copy sh2.cells(2,i) 'Step 2 - not done unless Step 1 is done if sh1.Range("A2").value = "copythis" then i = sh3.cells(2,sh3.columns.count).End(xltoLeft).column + 1 sh1.Range("B2").Copy sh3.Cells(2,i) end if End if End Sub

Miningco.com Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.