Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with If/then macro in VBA


I've tried for about 2 days now to get this code right and can't see
to. What I'm trying to do is after the value of a cell reaches <1, i
will cut and paste the entire row after it. Therefore its values wil
be erased in the process. The example will illustrate this, the shee
will essentially just roll foward rows after the specified days = 0.

My thoughs were if sheet1:A1<1, then copy row A2, erase A1

The file attached provides a clear example. I know attachments aren'
preferred but the formatting gets messed up when I try and copy an
paste from excel.

Any help is appreciated

+-------------------------------------------------------------------
|Filename: excelforum example4.zip
|Download: http://www.excelforum.com/attachment.php?postid=3519
+-------------------------------------------------------------------

--
dstoc
-----------------------------------------------------------------------
dstock's Profile: http://www.excelforum.com/member.php...fo&userid=2422
View this thread: http://www.excelforum.com/showthread.php?threadid=38062

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with If/then macro in VBA


Insert a commanbutton from the Control ToolBox menu. And attach the
following code:

Private Sub CommandButton1_Click()

Range("B11") = Range("B11") - 2
If Range("B11") < 1 Then
Range("B11").EntireRow.Delete
Range("B11") = Range("B11") - 2
End If

End Sub


Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=380628

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 recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 09:45 PM.

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

About Us

"It's about Microsoft Excel"