ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Cut copy and paste........... (https://www.excelbanter.com/excel-programming/377994-help-cut-copy-paste.html)

Mr.G[_3_]

Help with Cut copy and paste...........
 
Hi I have written this up. Now I want the cutcopypaste macro's to carry on if
the first sheet is full it must move on to number 2 and if 2 is move to
3..........
When a sheet is filled up it gives a error that it cant move the colums
without
losing data.

How do I say that in here?

Private Sub CommandButton1_Click()
Unload FrmInsert

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Call CutCopyPaste1
On Error Resume Next

Call CutCopyPaste2
On Error Resume Next

Call CutCopyPaste3
On Error Resume Next

Call CutCopyPaste4
Sheets("Proj").Select

FrmThank.Show

ActiveWorkbook.Save

End Sub

All that happens now is it cut's and paste in all four sheets
similtaniosly(sp)

Any suggestions?

Here is sample of macro CutCopyPaste1.The other is exactly the same exept it
pastes in the next sheet.

Sub CutCopyPaste1()

Application.ScreenUpdating = False

ActiveCell.Columns("A:E").EntireColumn.Select
Selection.Copy

Sheets("Sheet1").Select
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.Insert Shift:=xlToRight


Columns("A:E").EntireColumn.Select
With Selection.Interior
..ColorIndex = 1
..Pattern = xlSolid
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)
..LineStyle = xlContinuous
..Weight = xlMedium
..ColorIndex = xlAutomatic

End With
Selection.ColumnWidth = 1
Application.ScreenUpdating = True
End With
End Sub

Please Help.

Corey

Help with Cut copy and paste...........
 
for starters your :

Call CutCopyPaste1
On Error Resume Next

You need to specify what you want to occur.
EG.
sub copy_Paste()
if range("A1") <"" then
call cutpaste 1
else

....
end sub


"Mr.G" wrote in message
...
Hi I have written this up. Now I want the cutcopypaste macro's to carry on
if
the first sheet is full it must move on to number 2 and if 2 is move to
3..........
When a sheet is filled up it gives a error that it cant move the colums
without
losing data.

How do I say that in here?

Private Sub CommandButton1_Click()
Unload FrmInsert

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Call CutCopyPaste1
On Error Resume Next

Call CutCopyPaste2
On Error Resume Next

Call CutCopyPaste3
On Error Resume Next

Call CutCopyPaste4
Sheets("Proj").Select

FrmThank.Show

ActiveWorkbook.Save

End Sub

All that happens now is it cut's and paste in all four sheets
similtaniosly(sp)

Any suggestions?

Here is sample of macro CutCopyPaste1.The other is exactly the same exept
it
pastes in the next sheet.

Sub CutCopyPaste1()

Application.ScreenUpdating = False

ActiveCell.Columns("A:E").EntireColumn.Select
Selection.Copy

Sheets("Sheet1").Select
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.Insert Shift:=xlToRight


Columns("A:E").EntireColumn.Select
With Selection.Interior
.ColorIndex = 1
.Pattern = xlSolid
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic

End With
Selection.ColumnWidth = 1
Application.ScreenUpdating = True
End With
End Sub

Please Help.




Mr.G[_3_]

Help with Cut copy and paste...........
 
Ok so I need to say:
Call CutCopyPaste1 ' my macro
If workbook ColumIV = Full
Then
Call CutCopyPaste2
etc....
"Corey" wrote:

for starters your :

Call CutCopyPaste1
On Error Resume Next

You need to specify what you want to occur.
EG.
sub copy_Paste()
if range("A1") <"" then
call cutpaste 1
else

....
end sub


"Mr.G" wrote in message
...
Hi I have written this up. Now I want the cutcopypaste macro's to carry on
if
the first sheet is full it must move on to number 2 and if 2 is move to
3..........
When a sheet is filled up it gives a error that it cant move the colums
without
losing data.

How do I say that in here?

Private Sub CommandButton1_Click()
Unload FrmInsert

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Call CutCopyPaste1
On Error Resume Next

Call CutCopyPaste2
On Error Resume Next

Call CutCopyPaste3
On Error Resume Next

Call CutCopyPaste4
Sheets("Proj").Select

FrmThank.Show

ActiveWorkbook.Save

End Sub

All that happens now is it cut's and paste in all four sheets
similtaniosly(sp)

Any suggestions?

Here is sample of macro CutCopyPaste1.The other is exactly the same exept
it
pastes in the next sheet.

Sub CutCopyPaste1()

Application.ScreenUpdating = False

ActiveCell.Columns("A:E").EntireColumn.Select
Selection.Copy

Sheets("Sheet1").Select
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.Insert Shift:=xlToRight


Columns("A:E").EntireColumn.Select
With Selection.Interior
.ColorIndex = 1
.Pattern = xlSolid
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic

End With
Selection.ColumnWidth = 1
Application.ScreenUpdating = True
End With
End Sub

Please Help.






All times are GMT +1. The time now is 07:48 AM.

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