Cell to bring value and formatting both

Hi,
I enter formula =sheet1'!A1 in cell A1 on sheet2. It brings value from sheet1 A1. I want it to bring value as well as formatting both. Is it possible by vba code ? if so please help.
I have long list of articles. I change them frequently in sequence. I need to print them in A4 size. I have to get the long sheet to get break down in A4 size printable sheet retaining first two lines and last one line same (headings and name etc) in all
sheets. The sequence should change as I do in changes in long sheet.
regards

Hi Drsantoshsinghrathore,
Hi,
Thank you,
This code will format cell as number from text format ? Then it is not so helpful for my current problem. I want formatting about cell lining of border etc.
regards
Yes, the code would format cell to the number format based on the source cell. We also could set the cell format using
CellFormat object. And here is an example that set the border for the cell for your reference:
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
Also we can use the Recod Macro to get the simpliar code if we are not familair with Excel Object devleoping.
Regards & Fei
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Value and formatting both

    Hi,
    I have a long data sheet. Which may change data regularly. I need to break it as A4 size documents and get print out with first few lines in all copies. I made an automation for this purpose. It became a very big code and four command buttons. I tried but
    could not make it smaller and with single command button. Or if it works with change in the long main sheet.
    please make the corrections.
    https://onedrive.live.com/redir?resid=90B1344C0622B513!9293&authkey=!ACRjcUH7eBjARc4&ithint=file%2cxlsm
    http://1drv.ms/1AgmhJt
    regards

    I had to make Excel jump through a few hoops to make it do what you want, but here is code for a single command button. You'll still get one message box at the end because the code saves the workbook and you have turned on the document inspector.
    Private Sub CommandButton21_Click()
    Dim m As Long
    Dim i As Long
    Dim r As Long
    Dim rPrev As Long
    Dim rCurr As Long
    Dim wshS As Worksheet
    Dim wshT As Worksheet
    Dim strRange As String
    Dim lngView As Long
    Application.ScreenUpdating = False
    Set wshS = Worksheets("PERMANENT ARTICLES LIST")
    m = wshS.Range("A:M").Find(What:="*", SearchOrder:=xlByRows, _
    SearchDirection:=xlPrevious).Row
    With wshS.PageSetup
    .PrintArea = "$A$4:$M$" & m
    .PrintTitleRows = "$4:$9"
    End With
    Call SetPageSetup(wshS)
    wshS.Select
    lngView = ActiveWindow.View
    ActiveWindow.View = xlPageBreakPreview
    rPrev = 10
    For i = 1 To wshS.HPageBreaks.Count + 1
    Set wshT = Nothing
    On Error Resume Next
    Set wshT = Worksheets("PERMANENT ARTICLES " & i)
    On Error GoTo 0
    If wshT Is Nothing Then
    Set wshT = Worksheets.Add(After:=Worksheets(Worksheets.Count))
    wshT.Name = "PERMANENT ARTICLES " & i
    ActiveWindow.DisplayWhitespace = False
    Call SetPageSetup
    Else
    wshT.Cells.Clear
    End If
    wshS.Range("A4:M9").Copy Destination:=wshT.Range("A1")
    For r = 1 To 6
    wshT.Range("A" & r).RowHeight = wshS.Range("A" & (r + 3)).RowHeight
    Next r
    If i <= wshS.HPageBreaks.Count Then
    rCurr = wshS.HPageBreaks(i).Location.Row
    Else
    rCurr = m + 1
    End If
    strRange = "A" & rPrev & ":M" & (rCurr - 1)
    wshS.Range(strRange).Copy Destination:=wshT.Range("A7")
    For r = rPrev To rCurr - 1
    wshT.Range("A" & r - rPrev + 7).RowHeight = wshS.Range("A" & r).RowHeight
    Next r
    wshS.Range("A1:M1").Copy
    wshT.Range("A1").PasteSpecial Paste:=xlPasteColumnWidths
    rPrev = rCurr
    Next i
    Application.CutCopyMode = False
    wshS.Select
    ActiveWindow.View = lngView
    ActiveWorkbook.Save
    Application.ScreenUpdating = True
    End Sub
    Sub SetPageSetup(Optional wsh As Worksheet)
    If wsh Is Nothing Then
    Set wsh = ActiveSheet
    End If
    Application.PrintCommunication = False
    With wsh.PageSetup
    .Orientation = xlPortrait
    .PaperSize = xlPaperA4
    .PrintQuality = 200
    .LeftMargin = Application.InchesToPoints(0)
    .RightMargin = Application.InchesToPoints(0)
    .TopMargin = Application.InchesToPoints(0)
    .BottomMargin = Application.InchesToPoints(0)
    .HeaderMargin = Application.InchesToPoints(0)
    .FooterMargin = Application.InchesToPoints(0)
    End With
    Application.PrintCommunication = True
    End Sub
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • How to export table data with coloring of cell according to value.

    Hi all,
    I am using jdeveloper 11.1.1.6
    i want to export table data with lot of formatting. like with coloring of cell according to value and so many.How to do that?

    Hi,
    like with coloring of cell according to value and so many.How to do that?
    Answer is, you can't
    Frank

  • Help needed with referencing single Excel cells and formatting resulting text

    In InDesign CS5 I am putting together a 20pp catalogue of about 200 products. The plan is to have the product information, SKU code, quantity etc fixed, but have the prices (there are two i.e. pack price and individual price) being linked to an Excel spreadsheet. This is so that the prices can be updated in the Excel file and the InDesign file will pull the new prices through. In case you are wondering why I don't pull the whole set of information through, this is because there are a lot of copywriting changes done to the information once it's in InDesign - it's only going to be the prices that will be updated.
    I am planning on having two single cell tables in their own text frame, duly formatted with cell style, table style and paragraph style for the two price variables. This I am then going to have to repeat 200 times making sure I link to the next row down in Excel. This is going to be a hideous task but I see know way of modifying the cell in InDesign to point it to the next row in Excel. That's my first problem.
    My second problem is this. In the Excel sheet, the prices are formatted as UK currency and are therefore like this...
    £2.00
    £0.40
    £1.43
    £9.99
    £0.99
    £0.09
    What I will require is once I import that data (and refresh the data via a newly saved Excel file) is that the prices end up like this...
    £2.00
    40p
    £1.43
    £9.99
    99p
    9p
    So if the value is lower than £1.00 it needs a trailing 'p' added  and the leading zero and '£' sign stripped off. If the value is lower than £0.10 it also needs the zero after the decimal point stripping off.
    Then formatting wise, the '£' sign needs to be superscripted and the same for the 'p'. This I am assuming could be done via GREP?
    In summary, can anyone help with the first task of referecing the Excel cells on a cell by cell basis, given that it is the same cell column each time, but the next row down, and also point me in the right direction of the price formattting issues.
    Any help will be gratefully received.

    I would do this:
    Create on line with the formatting.
    Export as InDesign tagged text (TXT)
    Read out these tags
    In Excel exists a function to connect text from several cells and predfined text, there connect the content from cells with the paragraph styling tags. Do it in a seperate sheet. (Better would be to use a database like Access, there you can link your Excel sheet).
    Export this sheet as txt file
    Place this sheet as tagged text (there is an option in one of the sialog boxes).
    In preferences  < file handling you can specify that Tablecalculation Sheets and text is not embedded but linked, turn it on.

  • How to set default value and bg color of cross tab cell?

    Hi all
    Which way can I set default value and background color for a crosstab cell where there are no any data?
    I try to pass it in following way
    if isnull(CurrentFieldValue) then
    But is has no effect.

    Hi,
    If your field is numeric
    if currentfieldvalue =0 then cryellow else crnocolor
    if the field is numeric but you don't see the 0 check check if : Suppress if zero is ticked in the Number format tab.
    Regards

  • Letter-Spacing is different if I open my file at another Mac of us (Value is at both mac 0, but the text is longor), and if I cklick into the text-box, Illustrator says that the file was made in an other Version of Illustrator. We have on all macs the sam

    Letter-Spacing is different if I open my file at another Mac of us (Value is at both mac 0, but the text is longor), and if I cklick into the text-box, Illustrator says that the file was made in an other Version of Illustrator. We have on all macs the same system, os 10.8.3, cs6 and UTC4. And of course we`re using exactly the same font....

    Packpool,
    I believe the first thing to do is to update to 16.0.5.
    Adobe - Illustrator : For Macintosh

  • How to find greater than for 2 values and post greater value in new cell

    I'm trying to compose a formula for a cell whereby the answer is the greater of 2 other cells.i.e. e4 and f4 are the reference cells and g4 should have the greater of the 2 values as the answer in that cell. Should be simple but cannot figure it out. Thanks to the geniuses out there

    =Max(e4,f4)
    see page 254 of the Formulas and Function User Guide.

  • How to combine both values and subquery in the insert statement

    Hi everybody,
    This is a case of inserting rows into a final results table from a temporary one. Actually, one of the fields is not always given in the temporary table. Thus, when inserting the rows into the final results table, an error message comes up to.
    More clarification:
    final results table(F_RESULT): field1, field2, field3 ( they are also primary keys with not null constraint)
    temporary table(TEMP): field2, filed3
    Is it possible to combine both values and subquery branchs of the insert statement:
    Insert into F_RESULT (field2,field3) select field2,field3 from TEMP;
    Insert into F_RESULT (field1) values (0);
    into only one like this:
    Insert into F_RESULT (field1,field2,field3) values (0, select field2 form Temp, select field3 from Temp);
    Or there is another more effective solution. The main problem for me is the message that doesn't accept the null value. From the data integrity point of view, it is accepted to set field1 to zero.
    Any hints?
    Thanks for your reply.

    That's easy, you can select any value from a table:
    Insert into F_RESULT (field1,field2,field3)
    select 0, field2, field3 from Temp;

  • Quickaccess and Formatting bar both missing in 7.2

    I was wondering if anyone had encountered this before:
    I just recently re-installed FrameMaker 7.2 on a XP SP2 machine and I am unable to get both the Quickaccess and Formatting bar to display. Both are set to "on" in the .ini files and when I try to access them under View nothing happens at all. Any ideas?

    Thanks, Sheila,
    I actually thought about that last night after I posted this. I'll give it a try and let you know. I am expecting that might not be the case, however, because the check mark never shows up for the bars in question under view and I seem to recall that happening before when they were active?
    To answer your question about the 2 maker.ini files, yes I checked the one in documents and settings and the one in program files.
    Thanks for your help so far.

  • Need help - ResourceBundle - formated string value (and multi-line string)

    Hi
    Can I put a value for key on many rows and formatted??
    Ex.: Into a file properties can I put
    key =
    My
    name
    is
    JTonic
    When I try to get the value for key, I get "". Can I get "My name is JToniC" ???
    Thx in advance.

    http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html#load(java.io.InputStream)
    The logical line holding all the data for a key-element pair may be spread out across several adjacent natural lines by escaping the line terminator sequence with a backslash character, \.

  • Importing Excel Files and Formatting Issues

    Good afternoon ladies and gentlemen. When in doubt, post in the forum! Anyway, I am using java via ODBC to connect to an excel file to extract some info from it, using SQL statements. Everything can be extracted without any problems, however, Excel keeps pi$$ing me off by changing the format of the cell data.
    Firstly, I highlight every cell in my Excel file and format it as "Text."
    Then I extract the cell info by using a ResultSet and getting a String (even for numeric data - ResultSet.getString(...))
    What is getting on my nerves is that not only does it not extract numeric values followed by a string, when it does extract numeric values, it is adding a ".0" after the value.
    For example, if the cell value is 123, it will return 123.0
    If the cell value is 123SHOE, it returns null
    Furthemore, when editing the Excel file, after having every cell formatted as "Text," if I enter a number, say, as a zipcode, 123450000, it brings up an error! But the very definition of "Text" states that "Text format cells are treated as text even when a number is in the cell."
    The moral of the story is, I want to convert all data in the Excel file to "Text" and when extracting data from the file, I need to be able to extract numbers, numbers followed by characters, and everything else.
    Any suggestions?
    Thanks much,
    Josh

    Hey Dr. Clap, quick question for ya. I was checking out the Apache POI you recommended. More specifically HSSF. I noticed in the documentation that "String cells cannot conatin numbers and numeric cells cannot contain strings." Unfortunately, this is not going to work well with my app as some of the primary keys (I use the term loosely) are Strings which contain numbers. My main problem is that my app wont recognize the Strings containing numbers, so it returns null, and Excel is chopping off the leading zeroes and is popping up with an error because numbers are in the String. However, as I stated before, Excel notes that text cells can contain numbers!
    FYI, I am using Pervasive SQL to extract a given list of users in a DB (which I dont want to connect to directly) and am saving that generated query (list of users) into a text file. I then open the text file in Excel which parses it correctly and assigns the cells the correct values. So I don't think I can format the cells as text because I am importing the file I generate. I love doing things ass backwards :) Another reason I am using Excel files is so anyone can use the software so long as they have an Excel file with the appropriate columns within the file.
    Thanks yet again and I'll keep searching.
    Josh

  • How to keep all text and formats the same on multiple computers?

    I'm creating a file in InDesign CS6 on my Windows computer. I keep everything on my flash drive. When I go to school, I bring my flash drive with me and open it up on the Mac computer, but then there are are compatibility issues. There seems to be missing fonts and formats but the school uses the same version of InDesign I do. Now I was told a lot of things of how to keep the fonts and formats the same (embed the links, package the files, outline the text, save as IDML). However, it is not clear to me what each of those options do, so I don't know when or why to use them. So I just want to make sure that when I bring in my file in next Monday, I won't have any missing fonts or formats. What would you suggest is the proper things to do to keep everything the same on multiple computers? And could you please explain why?

    If you want cross-paltform comaptibility limit the fonts to OpenType or Windows TrueType formats, both of which work on both Mac and PC. To avoid missing font warnings the fonts must either be installed on each computer, or they must be in a folder named Document Fonts in the same location as the .indd file they are to work with. Packaging the file will build taht folder for you.
    the rest of the stuff in your list won't help you. .idml would allow you to open on an older version, but does nothing for your situation. Embedding the links will keep you from having missing links, but so will packaging, and embedded links will make the file much larger and harder to work with.
    For goodness sake, don't even think about outlining the text. It stops being text when you do that and you can no longer edit it.
    And finally. do yourself a big favor and don't attempt to actually work on your file directly from the flash drive. Copy the whole package folder to the hard drive, work on it, then copy back. You don't want to know how many files are fatally damaged by write errors on flash drives.

  • How do I do use the custom code and format for a percentage with 2 decimals in Report Builder 3.0?

    In Report Builder 3.0, I have the following custom code entered:
      Public Function SafeDivide(Numerator as String, Denominator as String) as String
    Try
    If Numerator = “” or Denominator = “” then
    Return “-“
    End if
    If Numerator = “-“ or Denominator = “-“ then
    Return “-“
    End If
    If CDbl(Numerator) =0 or CDbl(Denominator) = 0 then
    Return “-“
    End if
    If IsNothing(Numerator) or IsNothing(Denominator) then
    Return "-"
    End if
    Return Val( ( (CDbl(Numerator) / CDbl(Denominator) )*100 ) )
    Catch
    Return "-"
    End Try
    End Function
    I call the custom code in the cell with the following equation:
      =Code.SafeDivide(sum(Fields!TY_UNITS.Value)-sum(Fields!LY_UNITS.Value),sum(Fields!LY_UNITS.Value))
    I have the format for the cell set to 0.00%, but it’s not being followed.
    I want the result to be formatted as a Percentage, but instead I get values like: 
    -78.9473684210
    80
    300
    -100
    I have the format for the cell set to 0.00%, but it’s not being followed.
    How do I do use the custom code and format for a percentage with 2 decimals?

    Hi AngP,
    After testing the issue in my local environment, I can reproduce it. Based on my research, I find this issue is caused by the type of Units_VAR_Percentage cell is string, while the type of CDbl(Parameters!Var_Threshold.Value) is double, so they cannot be
    compared.
    To fix this issue, we can add a hidden column (Textbox91) next to the Units_VAR_Percentage column, and type =(sum(Fields!TY_UNITS.Value)-sum(Fields!LY_UNITS.Value)) /sum(Fields!LY_UNITS.Value) as the expression. Then use the expression below to control the
    BackgroundColor:
    =iif(iif(reportitems!Units_VAR_Percentage.Value=CStr(format(reportitems!Textbox91.Value,"0.00%")),reportitems!Textbox91.Value,0)>CDbl(Parameters!Var_Threshold.Value),"Yellow","PaleTurquoise")
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Ff67 , How Interpretation algoritms 001 take VALUE and REFER

    Dear experts
    How to Interpretation algoritms 001 take VALUE AND REFERENCE (XBLNR).
    BOTH VALUE AND REFERENCE .
    When I use algorithm 001 without REFERENCE , It take value , but when I
    put REFERENCE it take REFERENCE only and NO TAKE VALUE .
    I need that this algorithm take both VALUE AND REFERENCE.
    How Can do this ?
    Our electronic account statement , have many equal values , but I can
    take reference value for clear item open automatic . In this moment is
    manual this process.
    Is necesary implement  user-exit or badi for this solution ? Or any ideas to implement algoritms 901 ??
    Thanks for your comments

    Hi phantom,
    Row 1 is a Header Row. Row 10 is a Footer Row.
    Formula in Footer Cell B10
    =SUMIF(C,TRUE,B).
    SUMIF will sum the values in B where there is a tick (TRUE) in C.
    Regards,
    Ian.

  • Cells in Excel file output formatted to exponential format

    Hi ABAPers,
    I have generated an excel file using the FM, ' SO_NEW_DOCUMENT_ATT_SEND_API1 ' and cells in certain column are diplayed in the exponential format in excel. I had converted all the data to be populated into character type.
    As you may see, the Invoice Number ( vbeln CHAR 10 ) and the EAN Code ( ean11 CHAR 18 ) are in exponential format.
    But, as I expanded the cells, Invoice Number was displayed correctly but not EAN Code.
    Invoice Number - 5090002040
    EAN Code - 4011100191006
    Is it because EAN Code is only 13 Characters long when it was supposed to be 18?
    Please suggest any alternate logic for the EAN Code.
    Thanks.
    Arun G Nair

    Hello Alex,
    No spaces or apostrophes or inverted commas are to be added to the EAN Code ( 4011100191006 ).
    I have tried fetching the value and storing it into a string and then assigning that string to ean code variable but didn't work out. At the moment it is being stored in a variable of character datatype.
    As you may see, it works fine for Invoice Number, then why is it NOT working for EAN Code. They have the same character datatypes and are also asigned to variables of similar datatypes.

Maybe you are looking for

  • New movies do not show up in appletv

    Hi all, I have an appletv1, always worked great. Buts ince today new movies I add to my itunes will not show up on appletv. It does show the movies that were already there, but not new ones I add - even though they are the right format and I can see

  • Error while installing vCenter Server 6.0

    Hello! Got error while installing vCenter Server 6.0 on a Windows 2012 R2. During install pop-up said "An error occured while starting service 'invsvc'". What is the matter? Should I simply repeat the setup process? Few log files from big zip-file ar

  • Purchase and release order not allowed for TECO work orders

    Hi We are typically setting maintenance work orders to TECO once the physical work as been performed as that sets the reference date for showing the history of when the maintenance was performed, and when the maintenance call was completed. However,

  • Dell 24" multi-useage?

    I am very happy with the 2 24" Dell monitors we have (and got a very sweet deal on). Two things I was wondering about: a). If I were to connect the S-Video connector from one screen to the DSR-11, would I then see a proper video signal (i.e. would th

  • SAPMEINT -  Error at Global Configuration

    Hi ME / MII experts I am trying to configure SAPMEINT as per installation guide. Under SAP ME ERP Integration -> Administration -> Global Configuration, I get an error message 500   Internal Server Error   Error: "Application error occurred during th