Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello! Especially Tom
I have the best code supplied by tom to copy range based on data in a cell, however Is there a way to copy and paste the exact value. CODE START FINISH Monday Tuesday MAIN 3 Apr 4 Apr 7:00 15:00 7:00 15:30 TRICIA SUE 7:00 15:30 7:30 16:00 JEANNE ANNA call Jack Jo the dates are entered as a formula, $f2+1. But when I run the macro the resulting date which is printed in the new sheet is 1 Jan I have now added an hours column in d. what changed would I need to make Here is the code Tom provided Public Sub daily() Dim rng As Range, rng2 As Range Dim sh As Worksheet, sh1 As Worksheet Dim res As Variant Dim dt As Date, s As String s = InputBox("Enter date") If Not IsDate(s) Then MsgBox "Entry was not a date" Exit Sub End If dt = CDate(s) Set rng = Range("E2:bd2") res = Application.Match(CLng(dt), rng, 0) If IsError(res) Then MsgBox "Bad date provided" Exit Sub End If Set sh = ActiveSheet Sheets.Add After:=Worksheets(Worksheets.Count) Set sh1 = ActiveSheet sh.Columns(2).Resize(, 2).Copy sh1.Range("A1") rng(1, res).EntireColumn.Copy sh1.Range("D1") Set rng2 = sh1.Columns(1).Find(What:="CALL", _ After:=sh1.Range("A1"), _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If rng2 Is Nothing Then MsgBox "Problems, Call not found" Exit Sub End If sh1.Cells(rng2.Row + 1, 1).Resize(100).EntireRow.Delete End Sub Many thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Have I asked the wrong thing? or done something wrong??? no answer. oh well I kind of figured it out appologise if I caused offence |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
concatenate contents of cells whose contents resemble cell referem | Excel Worksheet Functions | |||
Copying cell contents from many cells and pasting into one cell | Excel Discussion (Misc queries) | |||
How do I keep the exact existing formula when drag copying? | Excel Discussion (Misc queries) | |||
Table of Contents (Exact match Hyperlinks?) | Excel Worksheet Functions | |||
Excel 2002 Copying Exact formulas | Excel Discussion (Misc queries) |