ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Please Help, Newbie VB programmer (https://www.excelbanter.com/excel-programming/327378-please-help-newbie-vbulletin-programmer.html)

[email protected]

Please Help, Newbie VB programmer
 
Hi all,

I am trying to create a macro in excel that will move data from page 1
to page 2 based on the condition that column F has data in the cell.
The data once it is removed from page 1 should leave no blank lines,
and the data should be placed on page 2, such that there is no blank
lines.

Any assistance is greatly appreciated.

Cheers,
Amy


Tom Ogilvy

Please Help, Newbie VB programmer
 
assume the data is constant data (not formula) in column F

Dim rng as Range, rng1 as Range
with worksheets(1)
set rng = .Range(.Cells(1,6),.Cells(rows.count,6).End(xlup))
End with
On Error Resume Next
set rng1 = rng.specialcells(xlconstants)
On Error goto 0
If not rng1 is nothing then
rng1.entirerow.copy destination:=worksheets(2).Range("A1")
rng1.entireRow.Delete
End If


--
Regards,
Tom Ogilvy

wrote in message
oups.com...
Hi all,

I am trying to create a macro in excel that will move data from page 1
to page 2 based on the condition that column F has data in the cell.
The data once it is removed from page 1 should leave no blank lines,
and the data should be placed on page 2, such that there is no blank
lines.

Any assistance is greatly appreciated.

Cheers,
Amy





All times are GMT +1. The time now is 01:55 AM.

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