Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default write a macro that changes format of selected cells


I need to figure out how to write a macro that will do what Dave
Peterson suggests in this link
http://www.excelforum.com/showthread.php?t=525679
with whatever cells I select. Any ideas?


--
DKY
------------------------------------------------------------------------
DKY's Profile: http://www.excelforum.com/member.php...o&userid=14515
View this thread: http://www.excelforum.com/showthread...hreadid=527715

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default write a macro that changes format of selected cells

Option Explicit
Sub testme()

Dim myCell As Range
Dim myRng As Range
Dim myArea As Range

Set myRng = Selection

Set myCell _
= ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell) .Offset(1, 1)

myCell.Copy
For Each myArea In myRng.Areas
myArea.PasteSpecial Paste:=xlPasteAll, _
Operation:=xlAdd, SkipBlanks:=False, Transpose:=False
Next myArea

Application.CutCopyMode = False
End Sub


DKY wrote:

I need to figure out how to write a macro that will do what Dave
Peterson suggests in this link
http://www.excelforum.com/showthread.php?t=525679
with whatever cells I select. Any ideas?

--
DKY
------------------------------------------------------------------------
DKY's Profile: http://www.excelforum.com/member.php...o&userid=14515
View this thread: http://www.excelforum.com/showthread...hreadid=527715


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default write a macro that changes format of selected cells


Well, that works... Thanks again Dave!! I appreciate it

--
DK
-----------------------------------------------------------------------
DKY's Profile: http://www.excelforum.com/member.php...fo&userid=1451
View this thread: http://www.excelforum.com/showthread.php?threadid=52771

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
Write macro to lock selected sheet when run office3000 Excel Discussion (Misc queries) 1 October 14th 08 06:49 PM
How to write a quote formula using only the cells selected with va Novice Excel Worksheet Functions 3 October 30th 06 01:07 PM
Macro to take selected cells times a selected cell Craig Excel Programming 4 October 24th 05 12:54 AM
How do I write VB to run Macro when sheet selected? JR_06062005 Excel Programming 3 June 6th 05 10:07 PM
Macro to format selected cells BeSmart[_2_] Excel Programming 4 May 7th 04 01:28 PM


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