#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default genius wanted VBS

Got this to work but it wont let me copy and paste rows or coumns need to
exclude then from the VBS any ideas?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Font.Size = 10
Cells.Interior.ColorIndex = 0
Target.Font.Size = 14
Target.Interior.ColorIndex = 24
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default genius wanted VBS

I'm not sure anybody will understand what you're asking for.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"lost in Chicago" wrote in message
...
Got this to work but it wont let me copy and paste rows or coumns need to
exclude then from the VBS any ideas?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Font.Size = 10
Cells.Interior.ColorIndex = 0
Target.Font.Size = 14
Target.Interior.ColorIndex = 24
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default genius wanted VBS

Simple. Target can be multiple cells when you copy a range of data like rows
or columns.. You need to have a for loop to look at every cell.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
for each cell in Target
cell.Font.Size = 10
cell.Interior.ColorIndex = 0
cell.Font.Size = 14
cell.Interior.ColorIndex = 24
next cell
End Sub


"lost in Chicago" wrote:

Got this to work but it wont let me copy and paste rows or coumns need to
exclude then from the VBS any ideas?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Font.Size = 10
Cells.Interior.ColorIndex = 0
Target.Font.Size = 14
Target.Interior.ColorIndex = 24
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default genius wanted VBS

didnt work Joel would like to limit the action to column 6 when selected the
color and font change but change back when unselected only in column 6 and it
must let me copy and paste the rows

"Joel" wrote:

Simple. Target can be multiple cells when you copy a range of data like rows
or columns.. You need to have a for loop to look at every cell.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
for each cell in Target
cell.Font.Size = 10
cell.Interior.ColorIndex = 0
cell.Font.Size = 14
cell.Interior.ColorIndex = 24
next cell
End Sub


"lost in Chicago" wrote:

Got this to work but it wont let me copy and paste rows or coumns need to
exclude then from the VBS any ideas?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Font.Size = 10
Cells.Interior.ColorIndex = 0
Target.Font.Size = 14
Target.Interior.ColorIndex = 24
End Sub

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default genius wanted VBS

Did it not run, or did it produce an error? To limit the code to column 6

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
for each cell in Target
if cell.column = 6 then
cell.Font.Size = 10
cell.Interior.ColorIndex = 0
cell.Font.Size = 14
cell.Interior.ColorIndex = 24
end if
next cell
End Sub




"lost in Chicago" wrote:

didnt work Joel would like to limit the action to column 6 when selected the
color and font change but change back when unselected only in column 6 and it
must let me copy and paste the rows

"Joel" wrote:

Simple. Target can be multiple cells when you copy a range of data like rows
or columns.. You need to have a for loop to look at every cell.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
for each cell in Target
cell.Font.Size = 10
cell.Interior.ColorIndex = 0
cell.Font.Size = 14
cell.Interior.ColorIndex = 24
next cell
End Sub


"lost in Chicago" wrote:

Got this to work but it wont let me copy and paste rows or coumns need to
exclude then from the VBS any ideas?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Font.Size = 10
Cells.Interior.ColorIndex = 0
Target.Font.Size = 14
Target.Interior.ColorIndex = 24
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default genius wanted VBS

Joel, ur suggest would not return to normal font and color. I did figure it
out. This is what I used and it does allow me now to copy and paste. Thanks
for your help.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 6 Then
Cells.Font.Size = 10
Cells.Interior.ColorIndex = 0
Target.Font.Size = 14
Target.Interior.ColorIndex = 24

End If
End Sub

"Joel" wrote:

Did it not run, or did it produce an error? To limit the code to column 6

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
for each cell in Target
if cell.column = 6 then
cell.Font.Size = 10
cell.Interior.ColorIndex = 0
cell.Font.Size = 14
cell.Interior.ColorIndex = 24
end if
next cell
End Sub




"lost in Chicago" wrote:

didnt work Joel would like to limit the action to column 6 when selected the
color and font change but change back when unselected only in column 6 and it
must let me copy and paste the rows

"Joel" wrote:

Simple. Target can be multiple cells when you copy a range of data like rows
or columns.. You need to have a for loop to look at every cell.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
for each cell in Target
cell.Font.Size = 10
cell.Interior.ColorIndex = 0
cell.Font.Size = 14
cell.Interior.ColorIndex = 24
next cell
End Sub


"lost in Chicago" wrote:

Got this to work but it wont let me copy and paste rows or coumns need to
exclude then from the VBS any ideas?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Font.Size = 10
Cells.Interior.ColorIndex = 0
Target.Font.Size = 14
Target.Interior.ColorIndex = 24
End Sub

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default genius wanted VBS

I would still keep the for loop. If you copy and paste cells then the
formating will only occur in the first cell of the copied region. i used the
ELSE to cover the area not in column 6.



Private Sub Worksheet_SelectionChange(ByVal Target As Range)
for each cell in target
If cell.Column = 6 Then
cell.Font.Size = 14
cell.Interior.ColorIndex = 24
else
Cell.Font.Size = 10
Cell.Interior.ColorIndex = 0
End If
next cell
End Sub



"lost in Chicago" wrote:

Joel, ur suggest would not return to normal font and color. I did figure it
out. This is what I used and it does allow me now to copy and paste. Thanks
for your help.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 6 Then
Cells.Font.Size = 10
Cells.Interior.ColorIndex = 0
Target.Font.Size = 14
Target.Interior.ColorIndex = 24

End If
End Sub

"Joel" wrote:

Did it not run, or did it produce an error? To limit the code to column 6

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
for each cell in Target
if cell.column = 6 then
cell.Font.Size = 10
cell.Interior.ColorIndex = 0
cell.Font.Size = 14
cell.Interior.ColorIndex = 24
end if
next cell
End Sub




"lost in Chicago" wrote:

didnt work Joel would like to limit the action to column 6 when selected the
color and font change but change back when unselected only in column 6 and it
must let me copy and paste the rows

"Joel" wrote:

Simple. Target can be multiple cells when you copy a range of data like rows
or columns.. You need to have a for loop to look at every cell.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
for each cell in Target
cell.Font.Size = 10
cell.Interior.ColorIndex = 0
cell.Font.Size = 14
cell.Interior.ColorIndex = 24
next cell
End Sub


"lost in Chicago" wrote:

Got this to work but it wont let me copy and paste rows or coumns need to
exclude then from the VBS any ideas?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Font.Size = 10
Cells.Interior.ColorIndex = 0
Target.Font.Size = 14
Target.Interior.ColorIndex = 24
End Sub

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
The team who designed Excel insert cut cells was a genius FSLLC Excel Worksheet Functions 0 April 28th 06 10:21 PM
Question for all the excel Genius OSSIE Excel Discussion (Misc queries) 2 March 3rd 06 11:31 PM
Excel Genius Required! nutsoup Excel Discussion (Misc queries) 4 February 5th 06 07:43 AM
Find and match totals Genius Req. this should be easier to read James Excel Worksheet Functions 1 October 3rd 05 10:12 PM
Find and match totals Genius Req. James Excel Worksheet Functions 0 October 3rd 05 07:31 PM


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