Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What code do I use to carry over a range of columm of cells over t
another sheet, only if they have a value in them. i.e. columm B has 1130, 1000, , 330, and I want to be able to carry those 3 values, ignore the value wit nothing, and line them up on a seperate sheet such as 1130,1000,330 Thanks! Loui -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
one way: Sub transfer() Dim lastrow Dim source_wks As Worksheet Dim target_wks As Worksheet Dim source_row As Long Dim target_row As Long Set source_wks = Worksheets("Sheet1") Set target_wks = Worksheets("sheet2") target_row = 1 lastrow = source_wks.Cells(Rows.Count, "B").End(xlUp).Row Application.ScreenUpdating = False With source_wks For source_row = 1 To lastrow If .Cells(source_row, "B").Value < "" Then target_wks.Cells(target_row, "A").Value = _ ..Cells(source_row, "B").Value target_row = target_row + 1 End If Next End With Application.ScreenUpdating = True End Sub -----Original Message----- What code do I use to carry over a range of columm of cells over to another sheet, only if they have a value in them. i.e. columm B has 1130, 1000, , 330, and I want to be able to carry those 3 values, ignore the value with nothing, and line them up on a seperate sheet such as 1130,1000,330 Thanks! Louis --- Message posted from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to transfer contents of 'Selected' cell to alternate cell. | Excel Worksheet Functions | |||
Can you transfer cell colour with value | Excel Worksheet Functions | |||
Transfer cell values to another cell by selecting button. | Excel Worksheet Functions | |||
Transfer specific characters from cell to another cell. | New Users to Excel | |||
Transfer results from a cell | Excel Discussion (Misc queries) |