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

apply border to excel sheet from vb coding

100+
P: 198
Hi
how border is applied to excel sheet when i transfer the data into it
i,e if i transfer five rows then border should be applied to five rows and if i transfer 10 rows then border should be on ten rows

please give some help
May 9 '08 #1
Share this Question
Share on Google+
2 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

Use this code:

Say, you have transfered 4 lines 7 columns..

Expand|Select|Wrap|Line Numbers
  1. With Range("A1:G4")
  2.  
  3. .Borders(XlBordersIndex.xlEdgeBottom).LineStyle =  _
  4. Excel.XlLineStyle.xlContinuous
  5.  
  6. .Borders(XlBordersIndex.xlEdgeBottom).Weight =  _
  7. Excel.XlBorderWeight.xlHairline
  8.  
  9. End With
  10.  
Regards
Veena
May 9 '08 #2

100+
P: 198
Hi,

Thanks for your reply

varinder


Hi,

Use this code:

Say, you have transfered 4 lines 7 columns..

Expand|Select|Wrap|Line Numbers
  1. With Range("A1:G4")
  2.  
  3. .Borders(XlBordersIndex.xlEdgeBottom).LineStyle =  _
  4. Excel.XlLineStyle.xlContinuous
  5.  
  6. .Borders(XlBordersIndex.xlEdgeBottom).Weight =  _
  7. Excel.XlBorderWeight.xlHairline
  8.  
  9. End With
  10.  
Regards
Veena
May 10 '08 #3

Post your reply

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