Move data from one cell to another cell in a different sheet when printing

DavyJones90

Board Regular
Joined
Feb 23, 2022
Messages
62
Office Version
  1. 365
Platform
  1. Windows
Hi,
I am trying to move data from on cell into a different sheet in a different celll when printing. the complication is. in one sheet I only have data
1675709217120.png


and in the other sheet I have a form

1675709240216.png


Each line in the first sheet will fill the entire form, but I don't actually need the form to be filled unless it is printed, at which point it should fill this form as many times as there are lines in the first table. so if I have 5 projects filled out in the first sheet, then 5 forms with that exact data should be printed.

I have been searching for hours, but no idea how to go about this.

Thank you for your help
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hi DavyJones,

the part you showed in the first sheet is only to fill Range("C21:C29") - are yu only talking about this as the information for the rest needs to come from a different source. And what about the data after it has been printed - where will be noted that it already has been printed?

2 more columns for the first sheet like

MrE_1229210_1702518_move data from one_230206.xlsm
KL
1Ready to PrintPrinted
29
Quelle
Cell Formulas
RangeFormula
K2K2=COUNTA(B2:J2)


This will only be part of the solution to your problem as you need to either get information by using VLookup for any customer or use VBA to collect this as well. A start:

VBA Code:
Public Sub MrE_1229210_1702518()
' https://www.mrexcel.com/board/threads/move-data-from-one-cell-to-another-cell-in-a-different-sheet-when-printing.1229210/

'only solution to a part of filling the form

Dim wsSrc As Worksheet
Dim wsTarg As Worksheet
Dim lngCounter As Long

Set wsSrc = ThisWorkbook.Worksheets("Quelle")
Set wsTarg = ThisWorkbook.Worksheets("Ziel")

With wsSrc
  For lngCounter = 2 To .Cells(.Rows.Count, "A").End(xlUp).Row
    If .Cells(lngCounter, "K").Value = 9 Then
      .Cells(lngCounter, "B").Resize(1, 9).Copy
      wsTarg.Range("C21").PasteSpecial Paste:=xlPasteAll, Transpose:=True
      Application.CutCopyMode = False
      wsTarg.PrintPreview
'      'change commands if you want the part printed out
'      wsTarg.PrintOut
      .Cells(lngCounter, "L").Value = Now
    End If
  Next lngCounter
End With

Set wsTarg = Nothing
Set wsSrc = Nothing
End Sub

With my sample the first sheet after a print may look like

MrE_1229210_1702518_move data from one_230206.xlsm
ABCDEFGHIJKL
1NameHHHHHHHHHReady to PrintPrinted
2a1DataDataDataDataDataDataDataDataData906.02.2023 20:29
3a2ZweiZweiZweiZweiZweiZweiZweiZwei8
4a3DreiDreiDreiDreiDreiDreiDreiDreiDrei906.02.2023 20:30
5a40
Quelle
Cell Formulas
RangeFormula
K2:K5K2=COUNTA(B2:J2)


Ciao,
Holger
 
Upvote 0

Forum statistics

Threads
1,214,631
Messages
6,120,645
Members
448,974
Latest member
DumbFinanceBro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top