VBA Excel 2007 Select three rows and format center with Column variable

Posted in dotnet, vb, vb.net | No Comments »

Good afternoon.

I am getting a compile error: Wrong number of arguments or invalid property assignment.

Range("A1" & ":" & LastColumn & 1, "A2" & ":" & LastColumn & 2, "A4" & ":" & LastColumn & 4).Select 

With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With 

'Trying to replace:
Range("A1:J1,A2:J2,A4:J4").Select

Any idea what may be the issue? Thnak you, WHEELS

dp.SyntaxHighlighter.ClipboardSwf = ‘/dp.SyntaxHighlighter/Scripts/clipboard.swf’
dp.SyntaxHighlighter.HighlightAll(’48e0c7a92c474188806e692ee09d4174′)

Similar:

  1. C#.NET 3.5 VS 2008 Excel 2007 Add-in hide tab Good afternoon. I figured out a very challenging issue, and discovered another one. When I created a tab on the Excel 2007 Ribbon, it displays...
  2. C#.NET 3.5 Excel 2007 VS 2008 Running VBA Macro(s) Good morning. Using Visual Studio 2008 (C# – Excel 2007 Add-in) I created a Excel 2007 Ribbon tab named Macros. It contains several buttons. I...
  3. Save Excel file as Tab delimited Hi,  I have no problem being able to save it as a CSV file, but there is no option to save one sheet as a...
  4. SQL Server SQL Select: How do I select rows where sum of a column is within a specified multiple? I have a process that needs to select rows from a Table (queued items) each row has a quantity column and I need to select...
  5. Unable to set the width of an Excel column I wrote a macro to copy a worksheet to a new workbook. I did this because the worksheet has VBA code in it, and the...

Leave a Reply