ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help on choosing the right way (https://www.excelbanter.com/excel-programming/309015-help-choosing-right-way.html)

Antonis

Help on choosing the right way
 
Hi,

I have a list of words around 60 on a spreadsheet on the same column, from
them I choose around 40 words on another column. Then manually I type the
other 20 words on another column. This manual way takes ages for me to do my
work everyday.

Using the VBA could you please give me the code so I can do this
automatically? Or some ideas on which commands should I use?

sebastienm

Help on choosing the right way
 
You could make it a bit easier manually:
Assuming your names are in column A
- enter a 1 in column B, in front of the names you want to select
- once done, sort A:B by Ascending/orDescending column B:
-select data A:B
-menu Data Sort, choose to sort by B
Now all the '1' rows are grouped together at the top, ie all selected names
- copy A1:A40: select A1:A40 then menu Edit Copy
- paste in column C: select C1, then menu Edit Paste
- copy/paste the same way for A41:A0 to D1

Regards,
Sebastien

"Antonis" wrote:

Hi,

I have a list of words around 60 on a spreadsheet on the same column, from
them I choose around 40 words on another column. Then manually I type the
other 20 words on another column. This manual way takes ages for me to do my
work everyday.

Using the VBA could you please give me the code so I can do this
automatically? Or some ideas on which commands should I use?


Tom Ogilvy

Help on choosing the right way
 
Assume the 60 words are in A1:A60
assume the 40 words are in B1:B40
put list of 20 in column C

Sub BuildList()
dim rng as range, rng1 as Range
Columns(1).Insert
Range("A1:A60").Formula = "=if(countif($C$1:$C$40,B1)0,"",na())
Set rng = Range("A1:A60").SpecialCells(xlFormulas,xlErrors)
set rng1 = Intersect(rng.EntireRow,Columns(2))
rng1.copy Destination:=Range("D1")
columns(1).Delete
End Sub

--
Regards,
Tom Ogilvy


"Antonis" wrote in message
...
Hi,

I have a list of words around 60 on a spreadsheet on the same column, from
them I choose around 40 words on another column. Then manually I type the
other 20 words on another column. This manual way takes ages for me to do

my
work everyday.

Using the VBA could you please give me the code so I can do this
automatically? Or some ideas on which commands should I use?





All times are GMT +1. The time now is 09:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com