datum vandaag zoeken en inhoud cellen kopiëren

littlepete

Well-known Member
Joined
Mar 26, 2015
Messages
503
Office Version
  1. 365
Platform
  1. Windows
hallo :)

aartsvervelend is het: je knutselt en bouwt en uiteindelijk werkt alles prima... de dag nadien wil je verderdoen, maar helaas: er wordt dienst geweigerd...

deze macro zoekt in een chronologische lijst naar de eerstvolgende datum op vandaag of daarna, de inhoud van de kolommen a b en c kopieer
ik daarna naar een andere sheet...

waar zit de fout dan ???

VBA Code:
Sub kalenderdag()
Dim Heden As Date
Dim Celx As Date
Dim Rij, Kolom As Integer
Sheets("kalender").Select
Heden = Date
Kolom = 3
Rij = 3
Do
Rij = Rij + 1
Celx = Cells(Rij, Kolom).Value
Loop Until Celx >= Heden
ActiveSheet.Cells(Rij, 1).Select
Range("a1").Value = ActiveSheet.Cells(Rij, 1) & " is " & ActiveSheet.Cells(Rij, 2) & " oud op " & Format(ActiveSheet.Cells(Rij, 3), "dddd, d mmmm yyyy")
End Sub

( de lijn celx = cells (...) kleurt geel )
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,215,204
Messages
6,123,630
Members
449,109
Latest member
Sebas8956

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