PIsabel
Board Regular
- Joined
- Feb 4, 2014
- Messages
- 126
- Office Version
- 365
- Platform
- Windows
Hello.
I have a sheet that concatenates the data entered.
For this I have several columns that concatenate the different options.
Then I have to pass all the columns to a list.
The code I have copies and pastes each set of columns, however the options that are not used create blank lines and this means that I end up not being able to use it the way I want, in addition to being a code that takes a long time to perform the task. .
I need code that copies the data from each set of columns, pastes this data into the "Components" sheet so that the list has no blank lines and orders the data by column A.
I have 30 sets of columns. All column sets have 7 columns and rows range from 3 to 1001.
Someone help me?
I have a sheet that concatenates the data entered.
For this I have several columns that concatenate the different options.
Then I have to pass all the columns to a list.
The code I have copies and pastes each set of columns, however the options that are not used create blank lines and this means that I end up not being able to use it the way I want, in addition to being a code that takes a long time to perform the task. .
I need code that copies the data from each set of columns, pastes this data into the "Components" sheet so that the list has no blank lines and orders the data by column A.
I have 30 sets of columns. All column sets have 7 columns and rows range from 3 to 1001.
Someone help me?
VBA Code:
Sub componentes_cria()
'copia e cola dados dos compostos para a folha componentes
Application.ScreenUpdating = False
Sheets("Componentes").Visible = True
Sheets("Componentes").Select
Range("A2:X30000").Select
Selection.ClearContents
'
Application.Goto Reference:="Comp_artigos"
Selection.Copy
Sheets("Componentes").Select
Range("A2").Select
Application.Run "Personal.xlsb!Colar_especial"
'
Sheets("Compostos").Select
Application.Goto Reference:="comp_fabrico"
Selection.Copy
Sheets("Componentes").Select
Range("A30000").End(xlUp).Offset(1, 0).Select
Application.Run "Personal.xlsb!Colar_especial"
'
Sheets("Compostos").Select
Application.Goto Reference:="comp_polimento"
Selection.Copy
Sheets("Componentes").Select
Range("A30000").End(xlUp).Offset(1, 0).Select
Application.Run "Personal.xlsb!Colar_especial"
'
Sheets("Compostos").Select
Application.Goto Reference:="comp_serralheiro"
Selection.Copy
Sheets("Componentes").Select
Range("A30000").End(xlUp).Offset(1, 0).Select
Application.Run "Personal.xlsb!Colar_especial"
'
Sheets("Compostos").Select
Application.Goto Reference:="comp_vidro"
Selection.Copy
Sheets("Componentes").Select
Range("A30000").End(xlUp).Offset(1, 0).Select
Application.Run "Personal.xlsb!Colar_especial"
'
Sheets("Compostos").Select
Application.Goto Reference:="comp_estofo"
Selection.Copy
Sheets("Componentes").Select
Range("A30000").End(xlUp).Offset(1, 0).Select
Application.Run "Personal.xlsb!Colar_especial"