Skip to main content

Conas luachanna a ghreamú do chealla infheicthe / scagtha in Excel amháin?

In Excel, má tá sonraí scagtha agat nó má chuir tú roinnt cealla i bhfolach, agus nuair a ghreamaíonn tú luachanna isteach sa raon scagtha nó i bhfolach, líonfar na cealla i bhfolach le luachanna greamaithe. Inseoidh mé duit roinnt cleasanna chun luachanna a ghreamú do chealla infheicthe in Excel amháin.

Greamaigh luachanna do chealla infheicthe le VBA

Greamaigh luachanna do chealla infheicthe le Greamaigh go Raon Infheicthe Kutools le haghaidh Excel smaoineamh maith3


Greamaigh luachanna do chealla infheicthe le VBA

In Excel, níl aon bhealaí eile ann chun an fhadhb seo a réiteach ach amháin VBA.

1. Brúigh Alt + F11 eochracha ag an am céanna, agus a Microsoft Visual Basic d’Fheidhmchláir pops fuinneoige.

2. cliceáil Ionsáigh > Modúil, ansin greamaigh faoi bhun chód VBA chuig fuinneog an Mhodúil popping.

VBA: Greamaigh luachanna do chealla infheicthe amháin.

Sub CopyFilteredCells()
	'Updateby20150203
	Dim rng1 As Range
	Dim rng2 As Range
	Dim InputRng As Range
	Dim OutRng As Range
	xTitleId     = "KutoolsforExcel"
	Set InputRng = Application.Selection
	Set InputRng = Application.InputBox("Copy Range :", xTitleId, InputRng.Address, Type: = 8)
	Set OutRng   = Application.InputBox("Paste Range:", xTitleId, Type: = 8)
	For Each rng1 In InputRng
		rng1.Copy
		For Each rng2 In OutRng
			If rng2.EntireRow.RowHeight > 0 Then
				rng2.PasteSpecial
				Set OutRng = rng2.Offset(1).Resize(OutRng.Rows.Count)
				Exit For
			End If
		Next
	Next
	Application.CutCopyMode = False
End Sub

3. cliceáil F5 eochair nó an Rith cnaipe, ansin tá dialóg ag gobadh amach duit chun luachanna a roghnú le cóipeáil. Féach an pictiúr:
doc-greamaigh-go-infheicthe-cill-1

4. Tar éis luachanna a roghnú, cliceáil OK, ansin tagann dialóg eile amach chun raon a roghnú chun na sonraí roghnaithe a ghreamú. Féach an pictiúr:
doc-greamaigh-go-infheicthe-cill-2

5. cliceáil OK. Ní fheiceann tú ach na cealla infheicthe a ghreamú de na luachanna roghnaithe.


Greamaigh luachanna do chealla infheicthe le Greamaigh go Raon Infheicthe Kutools le haghaidh Excel

I ndáiríre, má úsáideann tú Greamaigh go dtí an Raon Infheicthe fóntais de Kutools le haghaidh Excel - uirlis áisiúil Excel, is féidir leat an fhadhb a bhaineann le luachanna a ghreamú go raon infheicthe a réiteach go tapa agus go héasca.
greamaigh doc cill infheicthe 6

Kutools le haghaidh Excel, le níos mó ná 300 feidhmeanna úsáideacha, déanann sé do phoist níos éasca. 

Tar éis a shuiteáil Kutools for Excel, déan mar atá thíos le do thoil:Download Kutools Íoslódáil saor in aisce do Excel Anois!)

1. Roghnaigh raon luachanna is mian leat a chóipeáil agus a ghreamú, ansin cliceáil Kutools > Raon > Greamaigh go dtí an Raon Infheicthe > Gach or Luachanna Greamaigh amháin. Féach an pictiúr:
greamaigh doc cill infheicthe 7

2. Ansin a Greamaigh go dtí an Raon Infheicthe tagann dialóg amach, agus roghnaigh an raon a theastaíonn uait na luachanna a ghreamú. Féach an pictiúr:
greamaigh doc cill infheicthe 8

3. cliceáil OK. Anois déantar na luachanna roghnaithe a ghreamú den raon infheicthe amháin.

Ná greamaigh ach luachanna do chealla infheicthe Déan gach ceann a ghreamú de chealla infheicthe
greamaigh doc cill infheicthe 9 greamaigh doc cill infheicthe 10


Nóta:
Oibríonn an fóntais seo ar shraitheanna nó colúin atá i bhfolach agus scagtha

Cliceáil anseo chun faisnéis níos mionsonraithe a fháil maidir le fóntais Greamaigh go Raon Infheicthe.

  Greamaigh chuig Cealla Infheicthe Amháin

Uirlisí Táirgiúlachta Oifige is Fearr

🤖 Kutools AI Aide: anailís sonraí a réabhlóidiú bunaithe ar: Forghníomhú Chliste   |  Gin Cód  |  Cruthaigh Foirmlí Saincheaptha  |  Anailís a dhéanamh ar Sonraí agus Cairteacha a Ghin  |  Feidhmeanna Kutools a agairt...
Gnéithe Coitianta: Faigh, Aibhsigh nó Aithnigh Dúblaigh   |  Scrios Sraitheanna Bána   |  Comhcheangail Colúin nó Cealla gan Sonraí a Chailleadh   |   Babhta gan Foirmle ...
Cuardaigh Super: Ilchritéir VLookup    VLookup Illuachanna  |   VLookup Trasna Ilbhileoga   |   Amharc doiléir ....
Liosta anuas Casta: Go tapa Cruthaigh Liosta Anuas   |  Liosta anuas Cleithiúnach   |  Liosta Buail Isteach Ilroghnacha ....
Bainisteoir Colún: Cuir Líon Sonrach Colún leis  |  Colúin Bog  |  Scoránaigh Stádas Infheictheachta na gColún Ceilte  |  Déan comparáid idir Raonta & Colúin ...
Gnéithe Réadmhaoin: Fócas Eangaí   |  Amharc Dearaidh   |   Barra Mór na Foirmle    Leabhar Oibre & Bainisteoir Bileog   |  Leabharlann Acmhainní (Uaththéacs)   |  Piocálaí Dáta   |  Comhcheangail Bileoga Oibre   |  Criptigh/Díchriptigh Cealla    Seol Ríomhphost trí Liosta   |  Scagaire Super   |   Scagaire Speisialta (scagaire trom/iodálach/stailc tríd...) ...
Barr 15 Uirlisí12 Téacs uirlisí (Cuir Téacs, Bain Carachtair,...)   |   50 + Cairt cineálacha (Cairt Gantt,...)   |   40+ Praiticiúil Foirmlí (Ríomh aois bunaithe ar lá breithe,...)   |   19 Insertion uirlisí (Cuir isteach Cód QR, Ionsáigh Pictiúr ón gCosán,...)   |   12 Tiontú uirlisí (Uimhreacha le Focail, Comhshó Airgeadra,...)   |   7 Cumaisc & Scoilt uirlisí (Sraitheanna Comhcheangail Casta, Cealla Scoilt,...)   |   ... agus eile

Supercharge Do Scileanna Excel le Kutools le haghaidh Excel, agus Éifeachtúlacht Taithí Cosúil Ná Roimhe. Kutools le haghaidh Excel Tairiscintí Níos mó ná 300 Ardghnéithe chun Táirgiúlacht a Treisiú agus Sábháil Am.  Cliceáil anseo chun an ghné is mó a theastaíonn uait a fháil ...

Tuairisc


Tugann Tab Oifige comhéadan Tabbed chuig Office, agus Déan Do Obair i bhfad Níos Éasca

  • Cumasaigh eagarthóireacht agus léamh tabbed i Word, Excel, PowerPoint, Foilsitheoir, Rochtain, Visio agus Tionscadal.
  • Oscail agus cruthaigh cáipéisí iolracha i gcluaisíní nua den fhuinneog chéanna, seachas i bhfuinneoga nua.
  • Méadaíonn do tháirgiúlacht 50%, agus laghdaíonn sé na céadta cad a tharlaíonn nuair luch duit gach lá!
Comments (22)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thank you very much hundred times
This comment was minimized by the moderator on the site
After going absolutely crazy trying to find a solution, this worked - specifically, the macro for pasting INTO visible only cells. Note that I was copying only from unfiltered cells. However, the people complaining that it doesn't do both (which I'm not sure is true) should be quiet because it's pretty easy to copy FROM only visible/filtered cells into an unfiltered area. You don't need a macro for that (and if you're trying to do both, just do the copying of filtered cells in Excel first, then use this macro). Again, what Excel is fully unable to do on its own without a macro is to paste to visible cells only. This macro saved my bum. Thanks!
This comment was minimized by the moderator on the site
Thanks for your recognition.
This comment was minimized by the moderator on the site
This worked perfectly, thanks!
This comment was minimized by the moderator on the site
You can also easily do this without a plugin....
CTRL+C the cells you want to paste
Highlight the filtered/partially hidden range you're pasting to
CTRL+G
Select "Special"
Select "Visible Cells Only" & hit OK
CTRL+V
This comment was minimized by the moderator on the site
Thansk for you reply, but it does not work. With your method, it paste all cells including hidden ones with the copied values.
This comment was minimized by the moderator on the site
VBA method did not work! It copied the invisible cells into the visible cells. Now, I realize that the title doesn't say "How to paste values FROM VISIBLE/FILTERED CELLS to visible/filtered cells only in Excel?" but if my workbook is filtered, it's highly possible that this is what is needed. If this is what you want - copy from one section to another (or to simply paste values from certain cells right back to the same cells, so to remove the fomulas) you first need to copy/paste values to an unfiltered workbook/worksheet. THEN you can use the macro...or at least I hope you can. I didn't save my data and UNDO does not work....
This comment was minimized by the moderator on the site
I am sorry for that.
This comment was minimized by the moderator on the site
So is there any update version for this situation?
This comment was minimized by the moderator on the site
It is even more flexible and functional if the inner loop is constructed with Do While loop.
This comment was minimized by the moderator on the site
This was very helpful. Many thanks.
This comment was minimized by the moderator on the site
i am currently developing a macro. In that i need to do filter for a particular column for Eg: Column D and need to paste some values Eg: Valid in column B. only i need to paste the value for the filtered cells. And also i want to know the coding for multiple filters at a time. EG: filtering in one column and checking the value and again do filter in another column without making false for the previous filter. help me on this.
This comment was minimized by the moderator on the site
This works great up to record 1163 of 23,000 and then it stops. Why would it stop?
This comment was minimized by the moderator on the site
You rock! I've had this issue multiple times in the past but it became a back-breaker for the recent project. And you've helped me to fix it beautifully. THANK YOU!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations