mercredi 28 août 2019

VBA WITH EXCEL: Copy cell by cell values of one sheet by using loops and paste in another sheet by assigning filter to that Column

Can anyone please help me with the following scenario

1) I have a workbook of sheet1 with two columns and a few rows

2) Applied filter option for sheet1 data

3) Duplicated the sheet1 in the same workbook and renamed it as "Test"

4) Deleted the duplicates in sheet2,column-1 by applying filter

5) Now, I need your help in copying a cell value(the data is dynamic) of sheet2 and paste it in the filtered column-1 of sheet1 so that I can write the comments beside the two columns of sheet1.

**NOTE: DATA IS DYNAMIC

The columns are as below:

SHEET1:

COLUMN-1< <-->COLUMN-2

ABC <--> apple

ABC <--> windows

123 <--> android

ABC <--> os

B <--> phone

123 <--> android

ABC <--> blackberry

ABC <--> apple

B <--> Nokia

ABC <--> Lenovo

SHEET2(This is duplicated sheet):

COLUMN-1<-->COLUMN-2

ABC <--> apple

123 <--> android

B <--> phone

After pasting the copied cell value from 'Test' sheet and pasting it in the filter column-1 of 'Sheet1', the table will be seen like this

Comments also should be added by leaving the first row

STEP-1: (Example: abc)

COLUMN-1<-->COLUMN-2<-->COMMENT

ABC <--> apple <-->

ABC <--> windows <--> same as apple

ABC <--> os <--> same as apple

ABC <--> blackberry <--> same as apple

ABC <--> apple <--> same as apple

ABC <--> lenovo <--> same as apple

STEP-2: (Example: 123)

COLUMN-1<-->COLUMN-2<-->COMMENT

123 <--> android <-->

123 <--> android <--> same as android

STEP-3: (Example: B)

COLUMN-1<-->COLUMN-2<-->COMMENT

B <--> phone<-->

B <--> nokia <--> same as phone

I need the final result to look like this in SHEET1

COLUMN-1<-->COLUMN-2<-->COMMENT

ABC <--> apple<-->

ABC <--> windows <--> same as apple

123 <--> android <-->

ABC <--> os <--> same as apple

B <--> phone <-->

123 <--> android <--> same as android

ABC <--> blackberry <--> same as windows

ABC <--> apple <--> same as apple

B <--> Nokia <--> same as phone

ABC <--> Lenovo <--> same as apple

IT WOULD BE HELPFUL IF YOU CAN HELP ME ASAP.

Aucun commentaire:

Enregistrer un commentaire