Microsoft Excel - .Value = .Value?

Asked By Shaoxin
02-Jan-11 03:35 PM
Hi
Here is part of the code. I don't understand .Value = .Value
What does it mean?

   ' Fill in the Outline view in column A
    ' Look for last row in column B since many rows
    ' in column A are blank
    FinalReportRow = WSR.Cells(Rows.Count, 2).End(xlUp).Row
    With Range("A3").Resize(FinalReportRow - 2, 1)
      With .SpecialCells(xlCellTypeBlanks)
        .FormulaR1C1 = "=R[-1]C"
      End With
      .Value = .Value
    End With
  Rolf Jaeger replied to Shaoxin
02-Jan-11 04:25 PM
Hi Shaoxin:

again, it would help if you were trying to explain what you are trying to accomplish. The particular statement you are having trouble with I also find troubling, because the Resize property of a range typically is a multi-cell range for which the Value property really isn't defined.

In addition, I am having trouble seeing a reference to the SpecialCells(xlCellTypeBlanks) property of a range without a preceding On Error Resume Next error trapping statement. The reason: if there no blank cells found in the specified range referring to this property will return an error. The safer way to do this would be along the following lines:

Dim r as Range
Set r = .SpecialCells(xlCellTypeBlanks)
If Not r Is Nothing Then
   r.FormulaR1C1 = "=R[-1]C"
End If

Hope this helped,
Rolf
  Shaoxin replied to Rolf Jaeger
02-Jan-11 04:35 PM
Hi Rolf,

The code is to create a Report Showing Revenue by Product. Thank you very much for your help!
  Jackpot . replied to Shaoxin
02-Jan-11 11:44 PM

Hi Shaoxin

For your question "I don't understand .Value = .Value What does it mean?"

For data similar to the below; the macro would fill the blank cells in ColA with the data above..for example cell A2 will be applied with a formula =A1...and once the formula is applied   .Value = .Value converts the formula to its actual value.....Run the below macro and chekc out the difference with and without the line .Value =.Value

Col A Col B
1001 1
2
1002 1
2
3
1003 1
2
3
1004 1
2
3


Sub Macro()

Set wsr = ActiveSheet

    FinalReportRow = wsr.Cells(Rows.Count, 2).End(xlUp).Row
    With Range("A3").Resize(FinalReportRow - 2, 1)
    With .SpecialCells(xlCellTypeBlanks)
      .FormulaR1C1 = "=R[-1]C"
    End With
    .Value = .Value
    End With
End Sub

Create New Account
help
How do I collapse rows in Excel? Excel I would kike to collapse rows in excel but not sure what is the fundction, can anyone help? Excel Worksheet Discussions Microsoft Excel (1) Outline (1) Excel (1) Kike (1) Hi, You can group rows by using Data > Group and Outline > Group
insert cell outline Microsoft Excel dear help above formula in add for sheet("acc") in insert data all insert outline (boundry line) by vb. Sub CreateAccgst() Customer = Range("D1").Value staDate = Range("D4").Value todate With Sheets("Acc").Select End Sub Verry verry thanks. Create New Account keywords: insert, cell, outline description: dear help above formula in add for sheet(acc) in insert data all insert outline (boundry line) by vb. Sub CreateAccgst() Customer = Range(D1).Value s
Hiding / Expanding rows in Excel? Excel In Excel 2003 I would like to combining (for lack of a better term) several rows into numbers in the hidden rows in the main or top row. Thanks for any assistance Excel Discussions Microsoft Excel (1) Excel 2003 (1) Outline (1) Excel (1) Worksheet (1) Gsnu200903 (1) Squares (1) Help > outline > Create an Outline - - Gary
Creating notches in box whisker plots in Microsoft Excel Excel Does anyone know how to create the notches in the vertical box whisker charts? An be found in figure 10 of the following article: http: / / www.qualitydigest.com / oct97 / html / excel.html Thank you!! Excel Charting Discussions PERCENTILE (1) MEDIAN (1) Excel (1) QUARTILE (1) MAX (1) MIN (1) Sort (1) Hi, The technique describes how to A$50, 0.25)) / (1.35*50)))) You ROCK!!! On Sat, 16 Jun 2007, in microsoft.public.excel.charting, Andy Pope <andy@andypope.info> said: Any particular reason for preferring PERCENTILE(<range> , 0
Gruppierung Excel wie kann ich vorhandene Gliederungen in Excel per VBA zu- bzw. aufklappen ? MfG Jochen Wiechern Excel - German Discussions Microsoft Excel (1) Vista (1) Excel (1) VBA (1) Outline.ShowLevels (1) ColumnLevels (1) ShowLevels (1) RowLevels (1) Hallo Jochen, Gruppierung einblenden Worksheets("pricesheet").Outline.ShowLevels RowLevels: = 1, ColumnLevels: = 1 http: / / clever-forum.de / read.php?11, 82566, 82576#msg