Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cat Cat is offline
external usenet poster
 
Posts: 63
Default I feel so dumb - please help - this is a Range issue

I've written a macro to do some suttle things - I'm not a pro by any means
but can get by. I have data that is refreshed twice a month and I need to
add several steps to it. For one:

Col A contains Dates
Col B contains Later Dates
Col C needs to subtract Col A from Col B
I can't just copy the code =imsub(A:A,B:B) becasue it all varies
I've tried Nameing the Ranges, I've tried all sorts of stuff until I'm blue
- you would think that it would just hit me over the head what I need to do -
but it's not.

If anyone can save my sanity (I've said the Serenity Prayer one too many
times today) I would so appreciate it.

Thanks
Cat
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cat Cat is offline
external usenet poster
 
Posts: 63
Default I feel so dumb - please help - this is a Range issue

oh - and I AM a knucklehead - it should be Col B subtracts Col A to get the
days 2/5/2007-2/2/2007

Send me to my room

"Cat" wrote:

I've written a macro to do some suttle things - I'm not a pro by any means
but can get by. I have data that is refreshed twice a month and I need to
add several steps to it. For one:

Col A contains Dates
Col B contains Later Dates
Col C needs to subtract Col A from Col B
I can't just copy the code =imsub(A:A,B:B) becasue it all varies
I've tried Nameing the Ranges, I've tried all sorts of stuff until I'm blue
- you would think that it would just hit me over the head what I need to do -
but it's not.

If anyone can save my sanity (I've said the Serenity Prayer one too many
times today) I would so appreciate it.

Thanks
Cat

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default I feel so dumb - please help - this is a Range issue

How about:

Sub cat()
nq = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To nq
Cells(i, 3).Value = Cells(i, 2).Value - Cells(i, 1).Value
Next
End Sub


with sample results in cols A & B & C:

5/16/2007 5/31/2007 15
4/1/2007 6/3/2007 63
4/11/2007 4/21/2007 10

--
Gary''s Student - gsnu200726
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cat Cat is offline
external usenet poster
 
Posts: 63
Default I feel so dumb - please help - this is a Range issue

Thank you for answering my plea - I'll try that - tomorrow - My head hurts
now :(
Cat

"Gary''s Student" wrote:

How about:

Sub cat()
nq = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To nq
Cells(i, 3).Value = Cells(i, 2).Value - Cells(i, 1).Value
Next
End Sub


with sample results in cols A & B & C:

5/16/2007 5/31/2007 15
4/1/2007 6/3/2007 63
4/11/2007 4/21/2007 10

--
Gary''s Student - gsnu200726

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default I feel so dumb - please help - this is a Range issue

Advil


Don't become discouraged.
--
Gary''s Student - gsnu200726


"Cat" wrote:

Thank you for answering my plea - I'll try that - tomorrow - My head hurts
now :(
Cat

"Gary''s Student" wrote:

How about:

Sub cat()
nq = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To nq
Cells(i, 3).Value = Cells(i, 2).Value - Cells(i, 1).Value
Next
End Sub


with sample results in cols A & B & C:

5/16/2007 5/31/2007 15
4/1/2007 6/3/2007 63
4/11/2007 4/21/2007 10

--
Gary''s Student - gsnu200726

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
I feel like an idiot (restore unsaved document?) [email protected] Excel Discussion (Misc queries) 1 May 24th 07 07:17 PM
I FEEL AS IF MY BRAIN IS A CIRCULAR REFERENCE! Candentco Creative Collection[_2_] Excel Worksheet Functions 4 March 22nd 07 07:15 PM
replicate feel of checkbox robnsd Excel Discussion (Misc queries) 2 February 3rd 07 10:51 PM
How to make cel feel like word doc Tim Setting up and Configuration of Excel 1 January 17th 05 10:12 PM


All times are GMT +1. The time now is 07:32 AM.

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

About Us

"It's about Microsoft Excel"