Skip i'r prif gynnwys

Sut i gyfeirio at fformat a gwerth cell arall yn Excel?

Fel rheol, rydyn ni'n defnyddio'r fformiwla = A1 i gyfeirio cell A1 at gell arall yn y daflen waith. Ond ni all hyn ond cyfeirio at werth y gell. Os ydych chi am gyfeirio at werth y gell yn ogystal â'i fformat, mae angen i chi roi cynnig ar ddull arall. Mae'r erthygl hon yn darparu dau ddull i chi ei gyflawni.

Fformat cyfeirio a gwerth o gell arall gyda llun cysylltiedig wedi'i gludo
Fformat cyfeirio awto a gwerth o gell arall gyda VBA


Fformat cyfeirio a gwerth o gell arall gyda llun cysylltiedig wedi'i gludo

Gan dybio eich bod am gyfeirio at fformat a gwerth o gell A1, gwnewch fel a ganlyn i'w gyflawni.

1. Dewiswch y gell (A1) y mae angen i chi gyfeirio ati, yna copïwch hi gyda phwyso Ctrl + C allweddi.

2. Ewch i'r gell rydych chi am gysylltu'r gell gyfeirio, cliciwch ar y dde a dewiswch > Gludo Arbennig > Llun Cysylltiedig. Gweler y screenshot:

Nawr mae fformat a gwerth cell A1 yn cael ei gyfeirio at gell benodol. A bydd fformat a gwerth y ddwy gell hyn yn gydamserol fel y dangosir isod y screenshot.


Fformat cyfeirio awto a gwerth o gell arall gyda VBA

Gallwch gyfeirio at fformat a gwerth o gell arall yn awtomatig trwy redeg y sgript VBA isod.

1. De-gliciwch y tab dalen sy'n cynnwys y gell y mae angen i chi gyfeirio ati, ac yna cliciwch Gweld y Cod o'r ddewislen clicio ar y dde.

2. Yn y popping up Microsoft Visual ar gyfer Ceisiadau ffenestr, copïo a gludo'r cod VBA isod i mewn i ffenestr y Cod.

Cod VBA: Fformat cyfeirio a gwerth o gell arall

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    With Worksheets("Sheet1")
        If .Range("A1").Value2 <> "" Then
            On Error Resume Next
            Range("A1").Copy (.Range("E2"))
        End If
    End With
End Sub

Nodyn: Yn y cod, Sheet1 yw enw'r ddalen sy'n cynnwys y gell sydd ei hangen arnoch i gyfeirio'r gwerth a'r fformat. Mae A1 ac E2 yn golygu y bydd cell A1 yn cael ei chyfeirio at gell E2 yn awtomatig.

O hyn ymlaen, pan fydd gwerth yn newid yng nghell A1 Taflen 1, bydd ei werth a'i fformat yn cael eu cyfeirio at gell E2 ar unwaith.


Erthyglau perthnasol:

Offer Cynhyrchiant Swyddfa Gorau

🤖 Kutools AI Aide: Chwyldro dadansoddi data yn seiliedig ar: Cyflawniad Deallus   |  Cynhyrchu Cod  |  Creu Fformiwlâu Personol  |  Dadansoddi Data a Chynhyrchu Siartiau  |  Invoke Swyddogaethau Kutools...
Nodweddion Poblogaidd: Darganfod, Amlygu neu Adnabod Dyblygiadau   |  Dileu Rhesi Gwag   |  Cyfuno Colofnau neu Gelloedd heb Colli Data   |   Rownd heb Fformiwla ...
Super-edrych: VLookup Meini Prawf Lluosog    VLookup Gwerth Lluosog  |   VLookup Ar Draws Taflenni Lluosog   |   Edrych Niwlog ....
Rhestr gwympo Uwch: Creu Rhestr Gollwng yn Gyflym   |  Rhestr Gollwng Dibynnol   |  Rhestr Gollwng Aml-ddewis ....
Rheolwr Colofn: Ychwanegu Nifer Penodol o Golofnau  |  Symud Colofnau  |  Toglo Statws Gwelededd Colofnau Cudd  |  Cymharwch Ystodau a Cholofnau ...
Nodweddion dan Sylw: Ffocws ar y Grid   |  Golwg Dylunio   |   Bar Fformiwla Mawr    Rheolwr Llyfr Gwaith a Thaflen   |  Llyfrgell Adnoddau (Testun Auto)   |  Dewiswr Dyddiad   |  Cyfuno Taflenni Gwaith   |  Amgryptio/Dadgryptio Celloedd    Anfon E-byst trwy Restr   |  Hidlo Super   |   Hidlo Arbennig (hidlo mewn print trwm/italig/strikethrough...) ...
15 Set Offer Gorau12 Testun offer (Ychwanegu Testun, Dileu Cymeriadau,...)   |   50 + Siart Mathau (Siart Gantt,...)   |   40+ Ymarferol Fformiwlâu (Cyfrifwch oedran yn seiliedig ar ben-blwydd,...)   |   19 mewnosod offer (Mewnosod Cod QR, Mewnosod Llun o'r Llwybr,...)   |   12 Trosi offer (Rhifau i Eiriau, Trosi arian cyfred,...)   |   7 Uno a Hollti offer (Rhesi Cyfuno Uwch, Celloedd Hollt,...)   |   ... a mwy

Supercharge Eich Sgiliau Excel gyda Kutools ar gyfer Excel, a Phrofiad Effeithlonrwydd Fel Erioed Erioed. Kutools ar gyfer Excel Yn Cynnig Dros 300 o Nodweddion Uwch i Hybu Cynhyrchiant ac Arbed Amser.  Cliciwch Yma i Gael Y Nodwedd Sydd Ei Angen Y Mwyaf...

Disgrifiad


Mae Office Tab yn dod â rhyngwyneb Tabbed i Office, ac yn Gwneud Eich Gwaith yn Haws o lawer

  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
Comments (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Can I mirror the first 5 columns on each new sheet? I have the data just want the formatting to change with all sheets instead of having to do so repeatedly
This comment was minimized by the moderator on the site
Hello did the below code but it did not work
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Worksheets("Competitive Analysis Summary")
If .Range("BI7").Value2 <> "" Then
On Error Resume Next
Range("BI7").Copy (Worksheets("In Depth View - ADP").Range("E55"))
End If
End With
End Sub
This comment was minimized by the moderator on the site
Hi, after adding the code, you need to modify the worksheet "Competitive Analysis Summary" to enable the VBA.
This comment was minimized by the moderator on the site
How do I do that if I want to copy to a different sheet?
This comment was minimized by the moderator on the site
Hi Lil,
If you need to copy to a different sheet, please apply the below VBA code. Sheet1 is the original worksheet, Sheet3 is the destination worksheet. Please change them based on your needs.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Worksheets("Sheet1")
If .Range("A5").Value2 <> "" Then
On Error Resume Next
Range("A5").Copy (Worksheets("Sheet3").Range("E2"))
End If
End With
End Sub
This comment was minimized by the moderator on the site
How to run this code on excel? Does it need to be run on both worksheet? Can it be specific like step-by-step?
This comment was minimized by the moderator on the site
Hi Jesse,Hi, as the above code mentioned, you just need to fill the code in the original worksheet's Code window, when changing the cell value in the original worksheet (A5 in Sheet1 in this case), the code will be runned automatically. And cell A5 in Sheet1 will be copied to E2 in Sheet3.
This comment was minimized by the moderator on the site
Hi! Very cool!! Is there a way to do the first option in Google Spreadsheets?
This comment was minimized by the moderator on the site
Hi Julian,
Sorry we didn't test in Google sheets. Thanks for your comment.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations