Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Pasting the same Value into a Range of Cells

Can anyone advise how I can acheive this?

I want to be able to select a number of cells, paste the value of 1 into the
cells and change font to bold, with background of yellow

I have been able to do this with the following macro however it will only
paste the value "1" into the first cell, the formatting is applied to all
the selected range, however I want it to paste 1 into all the cells I have
selected

ie I select 1R x 3C run the macro below it will place the value of 1 into
the first cell and then applies the formatting to the 3 cells, I want the
value in there as well?

Hope this is clear
TIA
Michael

' Full_day_Hol Macro

ActiveCell.FormulaR1C1 = "1"
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Pasting the same Value into a Range of Cells

Selection.value = 1
You can use

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"mmc308" wrote in message ...
Can anyone advise how I can acheive this?

I want to be able to select a number of cells, paste the value of 1 into the
cells and change font to bold, with background of yellow

I have been able to do this with the following macro however it will only
paste the value "1" into the first cell, the formatting is applied to all
the selected range, however I want it to paste 1 into all the cells I have
selected

ie I select 1R x 3C run the macro below it will place the value of 1 into
the first cell and then applies the formatting to the 3 cells, I want the
value in there as well?

Hope this is clear
TIA
Michael

' Full_day_Hol Macro

ActiveCell.FormulaR1C1 = "1"
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Pasting the same Value into a Range of Cells

' Full_day_Hol Macro

With Selection
.Value = 1
With .Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With .Interior
.ColorIndex = 6
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End with
End Sub

--
Regards,
Tom Ogilvy


mmc308 wrote in message
...
Can anyone advise how I can acheive this?

I want to be able to select a number of cells, paste the value of 1 into

the
cells and change font to bold, with background of yellow

I have been able to do this with the following macro however it will only
paste the value "1" into the first cell, the formatting is applied to all
the selected range, however I want it to paste 1 into all the cells I have
selected

ie I select 1R x 3C run the macro below it will place the value of 1 into
the first cell and then applies the formatting to the 3 cells, I want the
value in there as well?

Hope this is clear
TIA
Michael

' Full_day_Hol Macro

ActiveCell.FormulaR1C1 = "1"
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End Sub




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Pasting the same Value into a Range of Cells

Many Thanks! it's working

Michael

"mmc308" wrote in message
...
Can anyone advise how I can acheive this?

I want to be able to select a number of cells, paste the value of 1 into

the
cells and change font to bold, with background of yellow

I have been able to do this with the following macro however it will only
paste the value "1" into the first cell, the formatting is applied to all
the selected range, however I want it to paste 1 into all the cells I have
selected

ie I select 1R x 3C run the macro below it will place the value of 1 into
the first cell and then applies the formatting to the 3 cells, I want the
value in there as well?

Hope this is clear
TIA
Michael

' Full_day_Hol Macro

ActiveCell.FormulaR1C1 = "1"
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
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
Copying and pasting from a range John Excel Worksheet Functions 3 June 6th 07 05:22 PM
Pasting a formula in multiple cells without changing the range Jeff Wheeler Excel Discussion (Misc queries) 3 June 15th 06 04:52 PM
pasting non-contiguous range of cells to new row, same cell locati Not excelling at macros New Users to Excel 3 April 4th 06 08:57 PM
Pasting on Filtered Data Sheets without pasting onto hidden cells CCSMCA Excel Discussion (Misc queries) 1 August 28th 05 01:22 PM
Finding a range for Copying & Pasting John R[_3_] Excel Programming 1 August 19th 03 03:54 PM


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