#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copydown

I'm trying to write a small macro just to automate an uploading process. Now
I'm not sure of the command to use but I want it to autofill down but only to
where the info stops. For example,
A B C
sum of B&C 1 1

now in A it's going to be 2 but in B&C there could be 29 rows or maybe 100
rows. i need it to autofill A down to where ever B&C stop. Thoughts?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200705/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Copydown

Roman,

try something like this

Sub Test

Dim lRow As Long
With ActiveSheet
lRow = Intersect(.UsedRange,
..Range("B:C")).SpecialCells(xlCellTypeLastCell).R ow
.Range("A2").Formula = "=SUM(B2:C2)"
.Range("A2:A" & lRow).FillDown
End With

End Sub



--
Hope that helps.

Vergel Adriano


"Roman via OfficeKB.com" wrote:

I'm trying to write a small macro just to automate an uploading process. Now
I'm not sure of the command to use but I want it to autofill down but only to
where the info stops. For example,
A B C
sum of B&C 1 1

now in A it's going to be 2 but in B&C there could be 29 rows or maybe 100
rows. i need it to autofill A down to where ever B&C stop. Thoughts?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200705/1


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Copydown

Hi Roman

This example will filldown A1 till the last row with data in B

Sub test()
Dim LastRow As Long
With Worksheets("Sheet1")
LastRow = .Cells(Rows.Count, "B").End(xlUp).Row
.Range("A1").AutoFill Destination:=.Range("A1:A" & LastRow) _
, Type:=xlFillDefault
End With
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Roman via OfficeKB.com" <u27679@uwe wrote in message news:7285361a96136@uwe...
I'm trying to write a small macro just to automate an uploading process. Now
I'm not sure of the command to use but I want it to autofill down but only to
where the info stops. For example,
A B C
sum of B&C 1 1

now in A it's going to be 2 but in B&C there could be 29 rows or maybe 100
rows. i need it to autofill A down to where ever B&C stop. Thoughts?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200705/1

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copydown

That's perfect!! thanks! one more question. When i use this:

Reponse = InputBox("Please enter Expiration Date")
Range("D1", Range("D1").End(xlDown)) = Response

Nothing happens...

Ron de Bruin wrote:
Hi Roman

This example will filldown A1 till the last row with data in B

Sub test()
Dim LastRow As Long
With Worksheets("Sheet1")
LastRow = .Cells(Rows.Count, "B").End(xlUp).Row
.Range("A1").AutoFill Destination:=.Range("A1:A" & LastRow) _
, Type:=xlFillDefault
End With
End Sub

I'm trying to write a small macro just to automate an uploading process. Now
I'm not sure of the command to use but I want it to autofill down but only to

[quoted text clipped - 4 lines]
now in A it's going to be 2 but in B&C there could be 29 rows or maybe 100
rows. i need it to autofill A down to where ever B&C stop. Thoughts?


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200705/1

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Copydown

You can use this

Dim rng As Range
Reponse = InputBox("Please enter Expiration Date")
Set rng = Range("D1", Range("D1").End(xlDown))
rng.Value = Reponse



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Roman via OfficeKB.com" <u27679@uwe wrote in message news:7285883816b7a@uwe...
That's perfect!! thanks! one more question. When i use this:

Reponse = InputBox("Please enter Expiration Date")
Range("D1", Range("D1").End(xlDown)) = Response

Nothing happens...

Ron de Bruin wrote:
Hi Roman

This example will filldown A1 till the last row with data in B

Sub test()
Dim LastRow As Long
With Worksheets("Sheet1")
LastRow = .Cells(Rows.Count, "B").End(xlUp).Row
.Range("A1").AutoFill Destination:=.Range("A1:A" & LastRow) _
, Type:=xlFillDefault
End With
End Sub

I'm trying to write a small macro just to automate an uploading process. Now
I'm not sure of the command to use but I want it to autofill down but only to

[quoted text clipped - 4 lines]
now in A it's going to be 2 but in B&C there could be 29 rows or maybe 100
rows. i need it to autofill A down to where ever B&C stop. Thoughts?


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200705/1

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
quicker copydown Naz Excel Programming 9 November 20th 06 03:43 AM


All times are GMT +1. The time now is 01:26 PM.

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"