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

I need help creating macros in excel. What I am trying to do is create a
loop (I think) to do the same thing in a column, say every 2 cells. For
example, I would like to take column C, and delete the contents in every
other cell. (delete C2, C4, C6, etc. for the entire column).
Any suggestions would be MOST helpful.
Thanks.
Lisa

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default creating macros in excel

Maybe something like:

Option Explicit
Sub testme()

Dim iRow As Long
Dim FirstRow As Long
Dim LastRow As Long
With Worksheets("sheet1")
FirstRow = 2
LastRow = .Cells(.Rows.Count, "C").End(xlUp).Row
For iRow = 2 To LastRow Step 2
.Cells(iRow, "C").ClearContents
Next iRow
End With

End Sub

Did delete mean clearcontents?

LisaVan wrote:

I need help creating macros in excel. What I am trying to do is create a
loop (I think) to do the same thing in a column, say every 2 cells. For
example, I would like to take column C, and delete the contents in every
other cell. (delete C2, C4, C6, etc. for the entire column).
Any suggestions would be MOST helpful.
Thanks.
Lisa


--

Dave Peterson
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
EXCEL 2007 CREATING A MACROS FIEGEHENK New Users to Excel 2 June 30th 09 12:31 AM
Creating Macros to connect 2 different excel sheet Trups Excel Discussion (Misc queries) 2 August 9th 07 04:54 AM
creating macros in excel ryanzoo06 Excel Discussion (Misc queries) 1 May 15th 07 07:43 PM
creating excel macros Dick Excel Worksheet Functions 0 June 2nd 06 06:56 PM
Creating Global excel macros Sebastian_var Excel Programming 3 February 10th 04 06:57 PM


All times are GMT +1. The time now is 06:13 AM.

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"