Results 1 to 12 of 12

Problem with defining Range in a With Statement

Threaded View

  1. #1
    Registered User
    Join Date
    11-03-2014
    Location
    Sydney, Australia
    MS-Off Ver
    2010
    Posts
    4

    Problem with defining Range in a With Statement

    New to VBA and I am building reports and with to do things with ROW titles.

    I can get individual statements to Bold cells to work but would be much better code to do using with Statement.

    This works
    OutSheet.Cells(OutLineNum, "A").Font.Bold = True
    OutSheet.Cells(OutLineNum, "B").Font.Bold = True
    OutSheet.Cells(OutLineNum, "C").Font.Bold = True
    OutSheet.Cells(OutLineNum, "D").Font.Bold = True
    OutSheet.Cells(OutLineNum, "E").Font.Bold = True
    OutSheet.Cells(OutLineNum, "F").Font.Bold = True
    OutSheet.Cells(OutLineNum, "G").Font.Bold = True
    OutSheet.Cells(OutLineNum, "H").Font.Bold = True
    OutSheet.Cells(OutLineNum, "I").Font.Bold = True
    OutSheet.Cells(OutLineNum, "J").Font.Bold = True
    I have tried various ways of putting With Range.. statements but none seem to work.

    OutSheet and OutLineNum are declared as Public

    Can someone tell me correct way to do a WITH statement for this.

    Much appreciated
    John
    Last edited by JWellar; 11-06-2014 at 05:38 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problem in defining range
    By aganesan99 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-10-2014, 05:04 AM
  2. [SOLVED] Problem defining a variable range to auto sum
    By Excelisdrivingmemad in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 02-03-2013, 11:55 AM
  3. Replies: 5
    Last Post: 12-25-2011, 08:19 AM
  4. Problem defining -some- variables in an IF statement
    By Gordon@work in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-05-2007, 02:51 AM
  5. Syntax problem defining range for pivot table
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2006, 02:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1