By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,529 Members | 864 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,529 IT Pros & Developers. It's quick & easy.

Convert Range to Activesheet.Cells

P: 25
Is there a way that I can convert

Expand|Select|Wrap|Line Numbers
  1. Range("A1:C1,A3:C6,A8:C11").Select
to the activesheets.cells format.

I am trying to select multiple cells with variable references.

Thanks
Apr 8 '08 #1
Share this Question
Share on Google+
3 Replies


kadghar
Expert 100+
P: 1,295
Is there a way that I can convert

Expand|Select|Wrap|Line Numbers
  1. Range("A1:C1,A3:C6,A8:C11").Select
to the activesheets.cells format.

I am trying to select multiple cells with variable references.

Thanks
sure, just dont select the range so quickly
do something like

Expand|Select|Wrap|Line Numbers
  1. Worksheets("destination").range("a1:c1").font = activesheets.cells.font
and the same for every "format" you wish to copy
Apr 9 '08 #2

P: 25
Let me try to rephrase this. I am trying to do a Selection.Find on a range of cells.

Example:
Expand|Select|Wrap|Line Numbers
  1. Range("B6:B8").Select
  2. Selection.Find(What:=dateref, LookIn:=xlValues, LookAt _
  3.         :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
  4.         False, SearchFormat:=False).Activate 
My problem is that I need to have the range that I search be variable. I only know how to use ActiveSheet.Cells(rownum, colnum) to select a single cell. Is there a way to do this for multiple cells?
Apr 17 '08 #3

kadghar
Expert 100+
P: 1,295
Let me try to rephrase this. I am trying to do a Selection.Find on a range of cells.

Example:
Expand|Select|Wrap|Line Numbers
  1. Range("B6:B8").Select
  2. Selection.Find(What:=dateref, LookIn:=xlValues, LookAt _
  3.         :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
  4.         False, SearchFormat:=False).Activate 
My problem is that I need to have the range that I search be variable. I only know how to use ActiveSheet.Cells(rownum, colnum) to select a single cell. Is there a way to do this for multiple cells?
oops, sorry

there's one way to use Range with cells:

Range(cells(1,1),cells(5,5)) will select the first 25 cells ^.^
Apr 18 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.