How to display value of another cell in the same style?

Abstract: Solve Excel's inability to copy cell formatting via formulas by using VBA or conditional formatting to display values with inherited styles.

Created: 2026-08-17 by
You cannot directly copy cell formatting via a standard formula because Excel formulas only return values, not styles. To display the value of another cell while preserving its appearance, you must use either VBA (Visual Basic for Applications) to programmatically copy the format or leverage Conditional Formatting with helper columns that mimic the source style. The most robust method for dynamic styling is using VBA to create a custom function or event handler. For users without coding experience, the alternative is to manually apply conditional rules that check if the target cell matches the source value and then apply specific formatting based on those conditions. This approach ensures consistency but requires setup time rather than real-time automatic syncing.

Understanding Excel's Formula Limitations

Excel treats formulas as pure data generators. When you write =A1 in cell B1, B1 displays the same number or text as A1, but it retains whatever formatting was applied to B1 prior to the entry. It does not inherit font color, background fill, borders, or number formats from the source cell. This design prevents circular reference issues and keeps calculation engines efficient. Many users attempt to use functions like FORMULATEXT or CELL, but these provide metadata about the formula itself, not the visual style of the referenced cell. Therefore, achieving "same style" display requires an external mechanism. The two primary pathways are:
  • VBA Macros: Automatically copies both value and format when changes occur.
  • Conditional Formatting: Applies styles dynamically based on logical comparisons.

Method 1: Using VBA to Copy Format Dynamically

If you need cell B1 to always look exactly like A1 whenever A1 changes, VBA is the only native solution that achieves true style inheritance. This involves placing code in the worksheet module rather than a standard module. First, open the Visual Basic Editor by pressing Alt + F11. In the Project Explorer, locate the sheet where your data resides (e.g., Sheet1). Double-click it to open the code window. Paste the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim srcCell As Range
    Dim destCell As Range
    
    ' Define the source and destination cells
    Set srcCell = Me.Range("A1")
    Set destCell = Me.Range("B1")
    
    ' Check if the source cell has changed
    If Not Intersect(Target, srcCell) Is Nothing Then
        Application.EnableEvents = False
        ' Copy the value
        destCell.Value = srcCell.Value
        ' Copy the format
        destCell.Copy
        destCell.PasteSpecial xlPasteFormats
        Application.CutCopyMode = False
        Application.EnableEvents = True
    End If
End Sub
This script triggers every time a change is made to the worksheet. It checks if the modified range intersects with cell A1. If it does, it copies the value and specifically uses PasteSpecial xlPasteFormats to transfer all visual attributes including font, fill, and borders. Note that this method works best for small ranges. If you have thousands of rows, looping through each row in a Worksheet_Change event can slow down Excel significantly. For large datasets, consider Method 2 or optimizing the VBA code to process entire ranges at once.

Method 2: Conditional Formatting for Static Styling

For users who prefer not to use macros, Conditional Formatting offers a way to make cells look similar without copying formats directly. This method relies on creating rules that compare values and apply predefined styles. Assume Cell A1 contains the value "Red" and is formatted with red text. You want Cell B1 to display the value from A1 but also appear red. Since B1 will contain the actual text "Red", you can set up a rule:
  1. Select cell B1.
  2. Go to the Home tab and click Conditional Formatting > New Rule.
  3. Select Use a formula to determine which cells to format.
  4. Enter the formula: =B1=A1
  5. Click Format and choose the desired font color, fill color, etc.
Now, whenever B1 equals A1, it will adopt the specified format. However, this does not automatically match *every* style attribute of A1 (like border thickness or exact hex colors unless you hardcode them). It is a simulation of style matching rather than true inheritance. To make this scalable, you can use helper columns. For example, if you want to sync styles across a range, you might extract the background color using a VBA user-defined function (UDF) and then feed that into conditional formatting logic, though this adds complexity.

Comparing Approaches for Your Workflow

Choosing between VBA and Conditional Formatting depends on your spreadsheet's size and update frequency.
  • Dynamic Updates: VBA updates instantly upon editing. Conditional Formatting updates when the sheet recalculates, which may be delayed if you have complex formulas elsewhere.
  • Maintainability: VBA code can become difficult to debug if multiple events interfere. Conditional Formatting rules are visible in the ribbon and easier for non-developers to audit.
  • Performance: Large-scale VBA operations can freeze the UI temporarily. Conditional Formatting is generally lighter on resources unless you have hundreds of rules applied to massive ranges.
If you frequently move data around or need pixel-perfect style replication across many cells, the VBA approach is superior. If you just need to highlight matches or apply simple color coding based on content, Conditional Formatting is sufficient and safer for shared workbooks where macros might be disabled by security policies. For more advanced techniques, such as extracting specific parts of data or combining percentages, see how to [Find the First Time Appears in Row in Excel](/news/1032291/find-first-time-appears-in-row-in-excel) or learn to [Combine 2 Percentages in Same Cell](/news/1033146/combined-2-percentage-in-same-cell).

Frequently Asked Questions

Can I copy formatting without copying the value?

Yes, you can use the PasteSpecial feature manually. Select the source cell, copy it (Ctrl+C), select the destination cell, right-click, choose Paste Special, and select Formats. This applies only the style, leaving the destination's existing value intact.

Why doesn't my Conditional Formatting update immediately?

Conditional Formatting relies on Excel's calculation engine. If your workbook is set to Manual Calculation mode, rules won't re-evaluate until you press F9. Ensure your settings are under Formulas > Calculation Options > Automatic for real-time updates.

Is there a no-code formula to copy colors?

No native Excel formula exists to retrieve or output color codes directly. Functions like CELL("color", A1) were deprecated years ago. Without VBA or Power Query scripts, you cannot extract a cell's background color into a variable for use in another cell's formatting logic.

How do I handle merged cells with this technique?

VBA PasteSpecial handles merged cells poorly and often breaks the merge structure. Conditional Formatting ignores merged cells' geometry and applies to the top-left cell of the range. It is recommended to unmerge cells before applying these styling synchronization methods to avoid unpredictable behavior.

What if I need to sync styles across different worksheets?

The provided VBA example works within a single sheet. To sync across sheets, you must modify the code to reference other sheets explicitly (e.g., Sheet2.Range("A1")) and place the code in the source sheet's module. Note that cross-sheet triggering events can cause recursive loops if not carefully managed with Application.EnableEvents.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More