Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Range and Cells

Hi,

How can I convert the <<Cells( iRow,iCol) (eg. Cells(3,8)) in which range
it is ( eg. Range("H3"))?

Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Range and Cells

Hi
why do you want to do this. Both statements return a range object. that
is
msgbox cells(3,8).address
returns the same as
msgbox range("H3").address

--
Regards
Frank Kabel
Frankfurt, Germany


stelios wrote:
Hi,

How can I convert the <<Cells( iRow,iCol) (eg. Cells(3,8)) in which
range it is ( eg. Range("H3"))?

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Range and Cells

Hi Frank,

I use VBA Code in a Access Project by which I export the data to Excel. I
want to use the Range function with eg. Range("A1:A9") automated because eg.
the Range(Cells(1,1), Cells(1,9)) bring me an error!

Thanks!


? "Frank Kabel" ???a?e st? µ???µa
...
Hi
why do you want to do this. Both statements return a range object. that
is
msgbox cells(3,8).address
returns the same as
msgbox range("H3").address

--
Regards
Frank Kabel
Frankfurt, Germany


stelios wrote:
Hi,

How can I convert the <<Cells( iRow,iCol) (eg. Cells(3,8)) in which
range it is ( eg. Range("H3"))?

Thanks!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Range and Cells

Hi
what error do you get. Maybe you are missing the workbook and worksheet
reference

--
Regards
Frank Kabel
Frankfurt, Germany


stelios wrote:
Hi Frank,

I use VBA Code in a Access Project by which I export the data to
Excel. I want to use the Range function with eg. Range("A1:A9")
automated because eg. the Range(Cells(1,1), Cells(1,9)) bring me an
error!

Thanks!


? "Frank Kabel" ???a?e st? µ???µa
...
Hi
why do you want to do this. Both statements return a range object.
that is
msgbox cells(3,8).address
returns the same as
msgbox range("H3").address

--
Regards
Frank Kabel
Frankfurt, Germany


stelios wrote:
Hi,

How can I convert the <<Cells( iRow,iCol) (eg. Cells(3,8)) in
which range it is ( eg. Range("H3"))?

Thanks!


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Range and Cells

Hi again,

I have reference for Microsoft Excel 11.0 ..... some times works the VBA
Code with the Cell function and some times it doesn't..... The errors I get
are 1004(method 'Cells' of object '_Global' failed) and 462 , sometimes,
(remote server isn't available), I work locally.

The Code:
eg.
....
LastRow=....(From Recordset)
LastCol=....(From Recordset)
.....
Set objXL = New Excel.Application
Set objWkb = objXL.Workbooks.Open(WKB_PATH & XLT_NAME)
objWkb.SaveAs (WKB_PATH & WKB_NAME)
objXL.Visible = True
Set objSht = objWkb.Worksheets(SHT_NAME) ' error 9
objSht.Activate
objSht.Range(Cells(LastRow, 2), Cells(LastRow, LastCol)).Font.Bold =
True ' <- Here is the Problem
.....

end of eg.

Any Idea?

Thanks!


? "Frank Kabel" ???a?e st? µ???µa
...
Hi
what error do you get. Maybe you are missing the workbook and worksheet
reference

--
Regards
Frank Kabel
Frankfurt, Germany


stelios wrote:
Hi Frank,

I use VBA Code in a Access Project by which I export the data to
Excel. I want to use the Range function with eg. Range("A1:A9")
automated because eg. the Range(Cells(1,1), Cells(1,9)) bring me an
error!

Thanks!


? "Frank Kabel" ???a?e st? µ???µa
...
Hi
why do you want to do this. Both statements return a range object.
that is
msgbox cells(3,8).address
returns the same as
msgbox range("H3").address

--
Regards
Frank Kabel
Frankfurt, Germany


stelios wrote:
Hi,

How can I convert the <<Cells( iRow,iCol) (eg. Cells(3,8)) in
which range it is ( eg. Range("H3"))?

Thanks!






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Range and Cells

Hi
try
Range(objSht.Cells(LastRow, 2), objSht.Cells(LastRow,
LastCol)).Font.Bold = True

--
Regards
Frank Kabel
Frankfurt, Germany


stelios wrote:
Hi again,

I have reference for Microsoft Excel 11.0 ..... some times works the
VBA Code with the Cell function and some times it doesn't..... The
errors I get are 1004(method 'Cells' of object '_Global' failed) and
462 , sometimes, (remote server isn't available), I work locally.

The Code:
eg.
...
LastRow=....(From Recordset)
LastCol=....(From Recordset)
....
Set objXL = New Excel.Application
Set objWkb = objXL.Workbooks.Open(WKB_PATH & XLT_NAME)
objWkb.SaveAs (WKB_PATH & WKB_NAME)
objXL.Visible = True
Set objSht = objWkb.Worksheets(SHT_NAME) ' error 9
objSht.Activate
objSht.Range(Cells(LastRow, 2), Cells(LastRow,
LastCol)).Font.Bold = True ' <- Here is the Problem
....

end of eg.

Any Idea?

Thanks!


? "Frank Kabel" ???a?e st? µ???µa
...
Hi
what error do you get. Maybe you are missing the workbook and
worksheet reference

--
Regards
Frank Kabel
Frankfurt, Germany


stelios wrote:
Hi Frank,

I use VBA Code in a Access Project by which I export the data to
Excel. I want to use the Range function with eg. Range("A1:A9")
automated because eg. the Range(Cells(1,1), Cells(1,9)) bring me an
error!

Thanks!


? "Frank Kabel" ???a?e st? µ???µa
...
Hi
why do you want to do this. Both statements return a range object.
that is
msgbox cells(3,8).address
returns the same as
msgbox range("H3").address

--
Regards
Frank Kabel
Frankfurt, Germany


stelios wrote:
Hi,

How can I convert the <<Cells( iRow,iCol) (eg. Cells(3,8)) in
which range it is ( eg. Range("H3"))?

Thanks!


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Range and Cells

Thanks Frank,

IT WORKED ......
.......
THANKS AGAIN!!!


? "Frank Kabel" ???a?e st? µ???µa
...
Hi
try
Range(objSht.Cells(LastRow, 2), objSht.Cells(LastRow,
LastCol)).Font.Bold = True

--
Regards
Frank Kabel
Frankfurt, Germany


stelios wrote:
Hi again,

I have reference for Microsoft Excel 11.0 ..... some times works the
VBA Code with the Cell function and some times it doesn't..... The
errors I get are 1004(method 'Cells' of object '_Global' failed) and
462 , sometimes, (remote server isn't available), I work locally.

The Code:
eg.
...
LastRow=....(From Recordset)
LastCol=....(From Recordset)
....
Set objXL = New Excel.Application
Set objWkb = objXL.Workbooks.Open(WKB_PATH & XLT_NAME)
objWkb.SaveAs (WKB_PATH & WKB_NAME)
objXL.Visible = True
Set objSht = objWkb.Worksheets(SHT_NAME) ' error 9
objSht.Activate
objSht.Range(Cells(LastRow, 2), Cells(LastRow,
LastCol)).Font.Bold = True ' <- Here is the Problem
....

end of eg.

Any Idea?

Thanks!


? "Frank Kabel" ???a?e st? µ???µa
...
Hi
what error do you get. Maybe you are missing the workbook and
worksheet reference

--
Regards
Frank Kabel
Frankfurt, Germany


stelios wrote:
Hi Frank,

I use VBA Code in a Access Project by which I export the data to
Excel. I want to use the Range function with eg. Range("A1:A9")
automated because eg. the Range(Cells(1,1), Cells(1,9)) bring me an
error!

Thanks!


? "Frank Kabel" ???a?e st? µ???µa
...
Hi
why do you want to do this. Both statements return a range object.
that is
msgbox cells(3,8).address
returns the same as
msgbox range("H3").address

--
Regards
Frank Kabel
Frankfurt, Germany


stelios wrote:
Hi,

How can I convert the <<Cells( iRow,iCol) (eg. Cells(3,8)) in
which range it is ( eg. Range("H3"))?

Thanks!




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
Summing a range of cells based on criteria in another range Jack Excel Worksheet Functions 2 November 5th 09 01:46 AM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
how to compute a range of cells based on another range of cells? HAROLD Excel Worksheet Functions 1 December 30th 05 09:32 PM
how to compute a range of cells based on another range of cells? HAROLD Excel Worksheet Functions 2 December 30th 05 07:55 PM
Count cells in one range based on parameters in another range dave roth Excel Worksheet Functions 2 March 29th 05 05:33 PM


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