#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Code

Hi Alex,

Here I also want to extend my appreciation to Norman Jones, his version is
also good because:


Thank you.

However, given a choice, I would go with Greg's more elegant code.

---
Regards,
Norman



"Alex" wrote in message
...
Rowan your explanation was really usefull want to thank you for that.

Here I also want to extend my appreciation to Norman Jones, his version is
also good because:

In Rowan version if I have some datas in the lower fields the cutted cells
will go under the datas, as to Norman's one My Range is going down wheter
I
have anything or not :)

Once Again Thank you all

I Love this Community and Love you all.

"Norman Jones" wrote:

Hi Alex,

Try:

Private Sub CommandButton1_Click()
Dim rng As Range

If Application.CountA(Me.Range("A10:D10")) = 0 Then
Set rng = Me.Range("A10")
Else
Set rng = Cells(Rows.Count, "A").End(xlUp)(2)
End If

Me.Range("B1:B4").Copy
rng.PasteSpecial Paste:=xlAll, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=True

End Sub


---
Regards,
Norman



"Alex" wrote in message
...
Dear ALL

I have the following question:

I placed the button on the excel sheet and assign a macro which cuts
the
cells' values from range b1:b4 and pastes them into range a10:d10
everything
is ok and works perfectly, but how can I do so that when I press the
button
again the new values which i type in range b1:b4 placed in a11:d11 ?
and
so
on, is it possible?

Please help me with this
Thank you in advance

My Code:
Private Sub CommandButton1_Click()
If Range("A10") = "" Then

Range("B1").Select
Selection.Cut
Range("A10").Select
ActiveSheet.Paste
Range("B2").Select
Selection.Cut
Range("B10").Select
ActiveSheet.Paste
Range("B3").Select
Selection.Cut
Range("C10").Select
ActiveSheet.Paste
Range("B4").Select
Selection.Cut
Range("D10").Select
ActiveSheet.Paste
Else
Range("B1").Select
Selection.Cut
Range("A11").Select
ActiveSheet.Paste
Range("B2").Select
Selection.Cut
Range("B11").Select
ActiveSheet.Paste
Range("B3").Select
Selection.Cut
Range("C11").Select
ActiveSheet.Paste
Range("B4").Select
Selection.Cut
Range("D11").Select
ActiveSheet.Paste

End If

End Sub

what should I do to continue the code for next ranges?






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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Create a newworksheet with VBA code and put VBA code in the new worksheet module ceshelman Excel Programming 4 June 15th 05 04:37 PM
stubborn Excel crash when editing code with code, one solution Brian Murphy Excel Programming 0 February 20th 05 05:56 AM
VBA code delete code but ask for password and unlock VBA protection WashoeJeff Excel Programming 0 January 27th 04 07:07 AM


All times are GMT +1. The time now is 11:39 PM.

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"