Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy cell with non null value


hello,

could anyone help...pls ???

my problem is,that in one column i have several values but some rows
are empty.

I need to copy this values(with whole column selected ) and paste it to
another column but without empty rows.



is it possible????

Thanks a lot for any answer


--
tommy_gtr
------------------------------------------------------------------------
tommy_gtr's Profile: http://www.excelforum.com/member.php...o&userid=26089
View this thread: http://www.excelforum.com/showthread...hreadid=474106

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default copy cell with non null value

tommy_gtr,

Sample code...
Sub PasteButOmitBlanks()
Range("B5:B10").Copy
Range("G4").PasteSpecial Paste:=xlPasteAll, SkipBlanks:=True
Application.CutCopyMode = False
End Sub

Jim Cone
San Francisco, USA




"tommy_gtr"
wrote in message

hello,
could anyone help...pls ???
my problem is,that in one column i have several values but some rows
are empty.
I need to copy this values(with whole column selected ) and paste it to
another column but without empty rows.
is it possible????
Thanks a lot for any answer
tommy_gtr
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default copy cell with non null value

Really empty cells??

Is your data all formulas or all constants?

If yes...
Select your range to copy
edit|goto|special
Select formulas or constants

Then copy those cells and past to the new location.

Alternatively--if you have a mixture of both formulas and constants...

Select your range
edit|copy
paste it to the new location
select that newly pasted range
edit|goto|special
click Blanks
edit|delete...|shift cells up



tommy_gtr wrote:

hello,

could anyone help...pls ???

my problem is,that in one column i have several values but some rows
are empty.

I need to copy this values(with whole column selected ) and paste it to
another column but without empty rows.

is it possible????

Thanks a lot for any answer

--
tommy_gtr
------------------------------------------------------------------------
tommy_gtr's Profile: http://www.excelforum.com/member.php...o&userid=26089
View this thread: http://www.excelforum.com/showthread...hreadid=474106


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy cell with non null value


hello,

thanks all for your ides.

but i think that "ilyas" is nearest to thing what I need.

dear Ilyas can you help with a liitle modification of your code.

I have problem that range where your code will place my values start
always from first row of column.

and when I tried specify range with something like this:

Range("E12" & cnt).Value = ce.Value

.... it doesnt works


please help me with this.....

tomm

--
tommy_gt
-----------------------------------------------------------------------
tommy_gtr's Profile: http://www.excelforum.com/member.php...fo&userid=2608
View this thread: http://www.excelforum.com/showthread.php?threadid=47410

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy cell with non null value


Hi Dave,

I think a little bit of your solution and its pretty good.

Its easy and its exactly what I need...I didnt see it at first
sight...


so special thanks to you...


tommy


--
tommy_gtr
------------------------------------------------------------------------
tommy_gtr's Profile: http://www.excelforum.com/member.php...o&userid=26089
View this thread: http://www.excelforum.com/showthread...hreadid=474106



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy cell with non null value


tommy_gtr Wrote:
hello,

thanks all for your ides.

but i think that "ilyas" is nearest to thing what I need.

dear Ilyas can you help with a liitle modification of your code.

I have problem that range where your code will place my values start
always from first row of column.

and when I tried specify range with something like this:

Range("E12" & cnt).Value = ce.Value

.... it doesnt works


please help me with this.....

tommy


If you do not want to start from first row then initialize cnt valu
for your row to start.


Code
-------------------
Sub test()

Dim myRng As Range
Dim ce As Range
Dim cnt

Set myRng = Range("D1:D20")
cnt=12 'this is the value from the row number to start
For Each ce In myRng
If ce.Value < 0 Then
Range("E" & cnt).Value = ce.Value
cnt = cnt + 1 'store row increment value
End If
Next ce

End Su
-------------------

--
ilyaskaz
-----------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...fo&userid=2396
View this thread: http://www.excelforum.com/showthread.php?threadid=47410

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy cell with non null value


thank you once again....

but I forget for one thing and it may be a big problem.

cause I want to paste it at same range from which I copy it.....

and its doesnt work.

is there any quick solution???

tommy


--
tommy_gtr
------------------------------------------------------------------------
tommy_gtr's Profile: http://www.excelforum.com/member.php...o&userid=26089
View this thread: http://www.excelforum.com/showthread...hreadid=474106

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default copy cell with non null value

If you're pasting over the original range, it really sounds like you want to
eliminate the empty cells.

select the range
edit|goto|special
click blanks
edit|delete
(entire row or shift cells up is up to you)

tommy_gtr wrote:

thank you once again....

but I forget for one thing and it may be a big problem.

cause I want to paste it at same range from which I copy it.....

and its doesnt work.

is there any quick solution???

tommy

--
tommy_gtr
------------------------------------------------------------------------
tommy_gtr's Profile: http://www.excelforum.com/member.php...o&userid=26089
View this thread: http://www.excelforum.com/showthread...hreadid=474106


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy cell with non null value


tommy_gtr Wrote:
hello,

could anyone help...pls ???

my problem is,that in one column i have several values but some rows
are empty.

I need to copy this values(with whole column selected ) and paste it to
another column but without empty rows.



is it possible????

Thanks a lot for any answer


Try this...

Code:
--------------------

Sub test()

Dim myRng As Range
Dim ce As Range
Dim cnt

Set myRng = Range("D1:D20")

For Each ce In myRng
If ce.Value < 0 Then
cnt = cnt + 1
Range("E" & cnt).Value = ce.Value
End If
Next ce

End Sub

--------------------

Cheers!!!
ilyas


--
ilyaskazi
------------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...o&userid=23969
View this thread: http://www.excelforum.com/showthread...hreadid=474106

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy cell with non null value


I think if i write a macro which will select cells with values and then
I copy and past it ,it will be working.

but i have a problem with macro, which will select non empty cells.

i wrote something like this....

Sub test()

Dim myRng As Range
Dim cel As Range

Set myRng = Range("D1:D20")

For Each cel In myRng

If cel.Value < 0 Then

cel.Select

End If

Next cel

End Sub


but it doesnt work very well....

please help....


tommy


--
tommy_gtr
------------------------------------------------------------------------
tommy_gtr's Profile: http://www.excelforum.com/member.php...o&userid=26089
View this thread: http://www.excelforum.com/showthread...hreadid=474106



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
Failed to save table attributes of (null) into (null). Luca Brasi Excel Discussion (Misc queries) 2 February 4th 09 04:30 PM
Sum a NULL cell ArcticWolf Excel Worksheet Functions 6 December 4th 08 02:04 PM
cell value based on null/not null in another cell spence Excel Worksheet Functions 1 February 18th 06 11:49 PM
null value cell Paul Excel Programming 2 December 15th 04 08:19 PM
Cell not null value? ddwebb Excel Programming 1 May 3rd 04 08:56 PM


All times are GMT +1. The time now is 09:38 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"