Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default copying the exact contents of cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default copying the exact contents of cells


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
concatenate contents of cells whose contents resemble cell referem cathyh Excel Worksheet Functions 3 May 23rd 09 12:16 PM
Copying cell contents from many cells and pasting into one cell MDN Excel Discussion (Misc queries) 7 December 10th 07 08:56 PM
How do I keep the exact existing formula when drag copying? Excelchallenged Excel Discussion (Misc queries) 2 October 19th 06 10:08 PM
Table of Contents (Exact match Hyperlinks?) Solusvir Excel Worksheet Functions 3 September 1st 06 01:39 AM
Excel 2002 Copying Exact formulas Kinjalip Excel Discussion (Misc queries) 4 April 27th 05 12:10 PM


All times are GMT +1. The time now is 11:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"