LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default How can I programatically move cell contents

Please follow following steps
1.Right Click toolbarclick control box
2.From control box select a command button and draw it to your sheet
3.Double click the command button to open code window and paste following
codes
Private Sub CommandButton1_Click()
Dim row As Integer, col As Integer
row = 1
col = 1

Dim str1 As String

While Sheet1.Cells(row, col).Value < ""
str1 = Sheet1.Cells(row + 1, col).Value

Sheet1.Cells(row, col + 2).Value = str1

Sheet1.Rows(row + 1).Delete

row = row + 1
Wend
End Sub

Now on clicking the command button, you get the result


Have a nice time€¦.

Chris
------
Convert your Excel spreadsheet into an online calculator.
http://www.spreadsheetconverter.com

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200902/1

 
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 move part of cell contents to another cell icetoad hisself Excel Discussion (Misc queries) 4 November 27th 06 07:19 PM
In Excel, how do you move the contents of 3 cells into 1 cell? Lillie Excel Discussion (Misc queries) 2 January 4th 06 03:40 AM
move cell contents David L Excel Discussion (Misc queries) 13 November 24th 05 08:18 PM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM
How to move cell contents Stephane Excel Discussion (Misc queries) 6 January 13th 05 12:49 AM


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