Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Borders in Columns

Hello,
I want to format my columns wth borders, but if I select
example Columns("A:G").Select
It will put borders all the way down. I want to put
borders just to the last row of data. So when user wants
to print report it doesn't show Borders all the way down.

Please advise any info. would appreciate it.

Thanks,

Juan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Borders in Columns


iLastRow = Cells(Rows.Count,"A").End(xlUp)
Range("A" & iLastRow & ":G" & iLastRow).Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Juan" wrote in message
...
Hello,
I want to format my columns wth borders, but if I select
example Columns("A:G").Select
It will put borders all the way down. I want to put
borders just to the last row of data. So when user wants
to print report it doesn't show Borders all the way down.

Please advise any info. would appreciate it.

Thanks,

Juan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Borders in Columns

Hello Bob,
not working. is there more to the code? Also Ken, When I
do your way it deletes my other Conditional formatting. I
have a formalu that looks for the word Total and formats
that row. I'll continue playing with it, but would like
any suggestions.

Thanks both of you.

Juan
-----Original Message-----

iLastRow = Cells(Rows.Count,"A").End(xlUp)
Range("A" & iLastRow & ":G" & iLastRow).Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Juan" wrote in message
...
Hello,
I want to format my columns wth borders, but if I select
example Columns("A:G").Select
It will put borders all the way down. I want to put
borders just to the last row of data. So when user wants
to print report it doesn't show Borders all the way

down.

Please advise any info. would appreciate it.

Thanks,

Juan



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Borders in Columns

Hi Juan,

I have just tested it again, and I put three values in A1, A2, A3 and ran
the code. Selected A4:G4 fine.

What happens with you?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Juan" wrote in message
...
Hello Bob,
not working. is there more to the code? Also Ken, When I
do your way it deletes my other Conditional formatting. I
have a formalu that looks for the word Total and formats
that row. I'll continue playing with it, but would like
any suggestions.

Thanks both of you.

Juan
-----Original Message-----

iLastRow = Cells(Rows.Count,"A").End(xlUp)
Range("A" & iLastRow & ":G" & iLastRow).Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Juan" wrote in message
...
Hello,
I want to format my columns wth borders, but if I select
example Columns("A:G").Select
It will put borders all the way down. I want to put
borders just to the last row of data. So when user wants
to print report it doesn't show Borders all the way

down.

Please advise any info. would appreciate it.

Thanks,

Juan



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Borders in Columns

Hello Bob,
I get error Method Range of object_Global failed. This is
portion of my macro:
Columns("D:J").Select
With Selection
.HorizontalAlignment = xlCenter
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
iLastRow = Cells(Rows.Count, "A").End(xlUp)
Range("A" & iLastRow & ":G" & iLastRow).Select

End Sub
Please advise.
thanks,
juan
-----Original Message-----
Hi Juan,

I have just tested it again, and I put three values in

A1, A2, A3 and ran
the code. Selected A4:G4 fine.

What happens with you?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Juan" wrote in message
...
Hello Bob,
not working. is there more to the code? Also Ken, When I
do your way it deletes my other Conditional formatting.

I
have a formalu that looks for the word Total and formats
that row. I'll continue playing with it, but would like
any suggestions.

Thanks both of you.

Juan
-----Original Message-----

iLastRow = Cells(Rows.Count,"A").End(xlUp)
Range("A" & iLastRow & ":G" & iLastRow).Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the

Purbecks
(remove nothere from the email address if mailing

direct)

"Juan" wrote in message
...
Hello,
I want to format my columns wth borders, but if I

select
example Columns("A:G").Select
It will put borders all the way down. I want to put
borders just to the last row of data. So when user

wants
to print report it doesn't show Borders all the way

down.

Please advise any info. would appreciate it.

Thanks,

Juan


.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Borders in Columns

Juan,

This is what I meant

iLastRow = Cells(Rows.Count, "D").End(xlUp)
Range("D" & iLastRow & ":J" & iLastRow).Select
With Selection
.HorizontalAlignment = xlCenter
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"juan" wrote in message
...
Hello Bob,
I get error Method Range of object_Global failed. This is
portion of my macro:
Columns("D:J").Select
With Selection
.HorizontalAlignment = xlCenter
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
iLastRow = Cells(Rows.Count, "A").End(xlUp)
Range("A" & iLastRow & ":G" & iLastRow).Select

End Sub
Please advise.
thanks,
juan
-----Original Message-----
Hi Juan,

I have just tested it again, and I put three values in

A1, A2, A3 and ran
the code. Selected A4:G4 fine.

What happens with you?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Juan" wrote in message
...
Hello Bob,
not working. is there more to the code? Also Ken, When I
do your way it deletes my other Conditional formatting.

I
have a formalu that looks for the word Total and formats
that row. I'll continue playing with it, but would like
any suggestions.

Thanks both of you.

Juan
-----Original Message-----

iLastRow = Cells(Rows.Count,"A").End(xlUp)
Range("A" & iLastRow & ":G" & iLastRow).Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the

Purbecks
(remove nothere from the email address if mailing

direct)

"Juan" wrote in message
...
Hello,
I want to format my columns wth borders, but if I

select
example Columns("A:G").Select
It will put borders all the way down. I want to put
borders just to the last row of data. So when user

wants
to print report it doesn't show Borders all the way
down.

Please advise any info. would appreciate it.

Thanks,

Juan


.



.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default Borders in Columns

So use Conditional Formatting. Assuming one of those columns will always have
data in it if any exists for that row, then just tie a CF formula to it, eg:-

Select A:G do Format / Cond Formatting - Formula Is =$A1<"" then hit the
format button and chosee left and right borders. Any time there is data in a
row in Col A, you will have borders from A:G

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"Juan" wrote in message
...
Hello,
I want to format my columns wth borders, but if I select
example Columns("A:G").Select
It will put borders all the way down. I want to put
borders just to the last row of data. So when user wants
to print report it doesn't show Borders all the way down.

Please advise any info. would appreciate it.

Thanks,

Juan



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.658 / Virus Database: 421 - Release Date: 09/04/2004


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
Borders Disappear When Hiding Columns EricG Excel Discussion (Misc queries) 0 January 4th 10 04:05 PM
Is there a way to "lock" columns, rows and borders so new data Gregg The Army Guy Excel Discussion (Misc queries) 0 March 28th 07 02:44 AM
Excel should allow you to create borders around columns easier robinsongary Excel Discussion (Misc queries) 5 June 10th 06 11:23 PM
Setting borders for two rows and all columns on spread sheet R OLEJAR Excel Worksheet Functions 0 February 1st 06 04:19 PM
Cell Borders and "Columns to Repeat at Left" DeLeo Excel Discussion (Misc queries) 0 July 28th 05 03:41 PM


All times are GMT +1. The time now is 02:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"