Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-13-2017, 04:34 AM
macropod's Avatar
macropod macropod is offline recording ranges in macros Windows 7 64bit recording ranges in macros Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try something along the lines of:
Code:
Sub Demo()
Dim r As Long, c As Long
With Selection
  For r = 2 To .Rows.Count Step 2
    For c = 1 To .Columns.Count
      ActiveCell.Offset(r - 1, c - 1).ClearContents
    Next
  Next
End With
End Sub
This will clear all selected cells in every second row of whatever you select.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 09-13-2017, 06:42 AM
ewso ewso is offline recording ranges in macros Windows 10 recording ranges in macros Office 2016
Advanced Beginner
recording ranges in macros
 
Join Date: Nov 2016
Posts: 80
ewso is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Try something along the lines of:
Code:
Sub Demo()
Dim r As Long, c As Long
With Selection
  For r = 2 To .Rows.Count Step 2
    For c = 1 To .Columns.Count
      ActiveCell.Offset(r - 1, c - 1).ClearContents
    Next
  Next
End With
End Sub
This will clear all selected cells in every second row of whatever you select.

thanks Macropod! that works!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
recording ranges in macros Recording Macros in Word doingwork Word VBA 1 10-10-2015 12:54 AM
recording ranges in macros Problems with Recording Macros jekronenfeld Excel 6 09-26-2013 03:07 PM
recording ranges in macros Recording Macros in Word cameron.fairfull Word VBA 2 09-08-2011 08:24 AM
Recording Macros Tutorial? Madhouse Word VBA 1 04-28-2010 01:32 PM
Tutorial recording macros Jaffa Word VBA 0 04-27-2010 09:14 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft