Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell Transfer

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Cell Transfer

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to transfer contents of 'Selected' cell to alternate cell. Gryndar Excel Worksheet Functions 7 December 20th 08 09:58 PM
Can you transfer cell colour with value Dragon2 Excel Worksheet Functions 3 December 17th 08 09:23 PM
Transfer cell values to another cell by selecting button. Gryndar Excel Worksheet Functions 2 November 24th 08 02:21 AM
Transfer specific characters from cell to another cell. Willing to learn New Users to Excel 3 June 17th 07 02:14 AM
Transfer results from a cell apesae Excel Discussion (Misc queries) 3 October 12th 06 10:36 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"