Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default Need help using VBA in excel.

The following is some VBA code being run using a Macro.

ActiveCell.Select
Selection.Interior.ColorIndex = 34
Range("G4").FormulaR1C1 = "=countbycolor(Belmarsh,34,FALSE)"
End Sub

"Belmarsh" is a cell range. Is there any way of inputting a cell specific
cell range i.e. E11:B12 or $E$11:$B$12 in VBA. Whenever I try this it errors.
Any ideas??

Thanks

Chris
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need help using VBA in excel.

Range("G4").Formula = "=countbycolor(E11:B12,34,FALSE)"

should work. Notice since the formula is in A1 notation, i use Formula
rather than FormulaR1C1

--
Regards,
Tom Ogilvy


"Chris" wrote in message
...
The following is some VBA code being run using a Macro.

ActiveCell.Select
Selection.Interior.ColorIndex = 34
Range("G4").FormulaR1C1 = "=countbycolor(Belmarsh,34,FALSE)"
End Sub

"Belmarsh" is a cell range. Is there any way of inputting a cell specific
cell range i.e. E11:B12 or $E$11:$B$12 in VBA. Whenever I try this it

errors.
Any ideas??

Thanks

Chris



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Need help using VBA in excel.

Hi
with activesheet.range("B11:E12")
..Interior.ColorIndex = 34
end with

--
Regards
Frank Kabel
Frankfurt, Germany

"Chris" schrieb im Newsbeitrag
...
The following is some VBA code being run using a Macro.

ActiveCell.Select
Selection.Interior.ColorIndex = 34
Range("G4").FormulaR1C1 = "=countbycolor(Belmarsh,34,FALSE)"
End Sub

"Belmarsh" is a cell range. Is there any way of inputting a cell

specific
cell range i.e. E11:B12 or $E$11:$B$12 in VBA. Whenever I try this it

errors.
Any ideas??

Thanks

Chris


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need help using VBA in excel.

Maybe you mean something like

Range("G4").Formula= "=countbycolor(" & _
range("e11:b12").Address & ",34,FALSE)"

--
Regards,
Tom Ogilvy


"Don Guillett" wrote in message
...

try
ActiveCell.Interior.ColorIndex = 34
Range("G4").Formula= "=countbycolor(range("e11:b12"),34,FALSE)"


--
Don Guillett
SalesAid Software

"Chris" wrote in message
...
The following is some VBA code being run using a Macro.

ActiveCell.Select
Selection.Interior.ColorIndex = 34
Range("G4").FormulaR1C1 = "=countbycolor(Belmarsh,34,FALSE)"
End Sub

"Belmarsh" is a cell range. Is there any way of inputting a cell

specific
cell range i.e. E11:B12 or $E$11:$B$12 in VBA. Whenever I try this it

errors.
Any ideas??

Thanks

Chris





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



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