Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 148
Default help with my code

Hi, I am wondering if someone might know of a way to tweak this a little. You
guys have been so helpful :)

1) I am having trouble with the column widths, each time it's run it removes
the width, is there a way to set this in the code?
2) Is there a way to have the currency in Column D show up looking like it
does in the other tab (example 14,995) rather than 14995.1
3) When they hit the macro button and it creates this information it needs
to do 2 things 1) dump into Word and 2) clear so it can create the tab again
with new data?

Any help is always appreciated! -- thank you!

Sub CreateTerm()
Dim ws As Worksheet
Set ws = gettab("TermSummary")
Dim rPart As Range
Dim Target As Range
With ws

' Enters the Currency
.Range("B3") = Worksheets("Planner").Range("A4")
.Range("C3") = Worksheets("Planner").Range("B4")
' Enters the # of Users
.Range("B4") = "Users"
.Range("C4") = Worksheets("Planner").Range("B5")
' Enters the Platform Type
.Range("B5") = "Platform/Edition"
.Range("C5") = Worksheets("Planner").Range("A12")
.Range("D5") = Worksheets("Planner").Range("B12")
' Enters the Addtl part numbers
Set Target = .Range("B6")
End With
Set rPart = Worksheets("Planner").Range("B17")
Do Until rPart = ""
Target.Offset(, 1) = rPart.Offset(, -1).Value
Target.Offset(, 2) = rPart.Offset(, 1)
Set Target = Target.Offset(1)
Set rPart = rPart.Offset(1)
Loop

' Enters the Grand Total Price
Target.Offset(, 0) = "Term Model Total Price"
Target.Offset(, 2) = Worksheets("Planner").Range("TermModel.Price")
Set Target = Target.Offset(1)
Set rPart = rPart.Offset(1)

' Enters the SW tools
Target.Offset(, 0) = "SW Tools"
Target.Offset(, 2) = Worksheets("SW Tools").Range("B13")
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default help with my code

Heather, I would be more inclined to help you except that you didn't even
bother to thank me for the help already provided for the index formula in
your "if and lookup" question. The answer to this is easy.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Heather" wrote in message
...
Hi, I am wondering if someone might know of a way to tweak this a little.
You
guys have been so helpful :)

1) I am having trouble with the column widths, each time it's run it
removes
the width, is there a way to set this in the code?
2) Is there a way to have the currency in Column D show up looking like it
does in the other tab (example 14,995) rather than 14995.1
3) When they hit the macro button and it creates this information it needs
to do 2 things 1) dump into Word and 2) clear so it can create the tab
again
with new data?

Any help is always appreciated! -- thank you!

Sub CreateTerm()
Dim ws As Worksheet
Set ws = gettab("TermSummary")
Dim rPart As Range
Dim Target As Range
With ws

' Enters the Currency
.Range("B3") = Worksheets("Planner").Range("A4")
.Range("C3") = Worksheets("Planner").Range("B4")
' Enters the # of Users
.Range("B4") = "Users"
.Range("C4") = Worksheets("Planner").Range("B5")
' Enters the Platform Type
.Range("B5") = "Platform/Edition"
.Range("C5") = Worksheets("Planner").Range("A12")
.Range("D5") = Worksheets("Planner").Range("B12")
' Enters the Addtl part numbers
Set Target = .Range("B6")
End With
Set rPart = Worksheets("Planner").Range("B17")
Do Until rPart = ""
Target.Offset(, 1) = rPart.Offset(, -1).Value
Target.Offset(, 2) = rPart.Offset(, 1)
Set Target = Target.Offset(1)
Set rPart = rPart.Offset(1)
Loop

' Enters the Grand Total Price
Target.Offset(, 0) = "Term Model Total Price"
Target.Offset(, 2) = Worksheets("Planner").Range("TermModel.Price")
Set Target = Target.Offset(1)
Set rPart = rPart.Offset(1)

' Enters the SW tools
Target.Offset(, 0) = "SW Tools"
Target.Offset(, 2) = Worksheets("SW Tools").Range("B13")


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 148
Default help with my code

I'm so sorry about that.. I've been going in so many directions today that I
haven't had a chance to read your answers .. I'll go look now :)

"Don Guillett" wrote:

Heather, I would be more inclined to help you except that you didn't even
bother to thank me for the help already provided for the index formula in
your "if and lookup" question. The answer to this is easy.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Heather" wrote in message
...
Hi, I am wondering if someone might know of a way to tweak this a little.
You
guys have been so helpful :)

1) I am having trouble with the column widths, each time it's run it
removes
the width, is there a way to set this in the code?
2) Is there a way to have the currency in Column D show up looking like it
does in the other tab (example 14,995) rather than 14995.1
3) When they hit the macro button and it creates this information it needs
to do 2 things 1) dump into Word and 2) clear so it can create the tab
again
with new data?

Any help is always appreciated! -- thank you!

Sub CreateTerm()
Dim ws As Worksheet
Set ws = gettab("TermSummary")
Dim rPart As Range
Dim Target As Range
With ws

' Enters the Currency
.Range("B3") = Worksheets("Planner").Range("A4")
.Range("C3") = Worksheets("Planner").Range("B4")
' Enters the # of Users
.Range("B4") = "Users"
.Range("C4") = Worksheets("Planner").Range("B5")
' Enters the Platform Type
.Range("B5") = "Platform/Edition"
.Range("C5") = Worksheets("Planner").Range("A12")
.Range("D5") = Worksheets("Planner").Range("B12")
' Enters the Addtl part numbers
Set Target = .Range("B6")
End With
Set rPart = Worksheets("Planner").Range("B17")
Do Until rPart = ""
Target.Offset(, 1) = rPart.Offset(, -1).Value
Target.Offset(, 2) = rPart.Offset(, 1)
Set Target = Target.Offset(1)
Set rPart = rPart.Offset(1)
Loop

' Enters the Grand Total Price
Target.Offset(, 0) = "Term Model Total Price"
Target.Offset(, 2) = Worksheets("Planner").Range("TermModel.Price")
Set Target = Target.Offset(1)
Set rPart = rPart.Offset(1)

' Enters the SW tools
Target.Offset(, 0) = "SW Tools"
Target.Offset(, 2) = Worksheets("SW Tools").Range("B13")



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default help with my code

I sent you a file YESTERDAY .

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Heather" wrote in message
...
I'm so sorry about that.. I've been going in so many directions today that
I
haven't had a chance to read your answers .. I'll go look now :)

"Don Guillett" wrote:

Heather, I would be more inclined to help you except that you didn't even
bother to thank me for the help already provided for the index formula in
your "if and lookup" question. The answer to this is easy.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Heather" wrote in message
...
Hi, I am wondering if someone might know of a way to tweak this a
little.
You
guys have been so helpful :)

1) I am having trouble with the column widths, each time it's run it
removes
the width, is there a way to set this in the code?
2) Is there a way to have the currency in Column D show up looking like
it
does in the other tab (example 14,995) rather than 14995.1
3) When they hit the macro button and it creates this information it
needs
to do 2 things 1) dump into Word and 2) clear so it can create the tab
again
with new data?

Any help is always appreciated! -- thank you!

Sub CreateTerm()
Dim ws As Worksheet
Set ws = gettab("TermSummary")
Dim rPart As Range
Dim Target As Range
With ws

' Enters the Currency
.Range("B3") = Worksheets("Planner").Range("A4")
.Range("C3") = Worksheets("Planner").Range("B4")
' Enters the # of Users
.Range("B4") = "Users"
.Range("C4") = Worksheets("Planner").Range("B5")
' Enters the Platform Type
.Range("B5") = "Platform/Edition"
.Range("C5") = Worksheets("Planner").Range("A12")
.Range("D5") = Worksheets("Planner").Range("B12")
' Enters the Addtl part numbers
Set Target = .Range("B6")
End With
Set rPart = Worksheets("Planner").Range("B17")
Do Until rPart = ""
Target.Offset(, 1) = rPart.Offset(, -1).Value
Target.Offset(, 2) = rPart.Offset(, 1)
Set Target = Target.Offset(1)
Set rPart = rPart.Offset(1)
Loop

' Enters the Grand Total Price
Target.Offset(, 0) = "Term Model Total Price"
Target.Offset(, 2) = Worksheets("Planner").Range("TermModel.Price")
Set Target = Target.Offset(1)
Set rPart = rPart.Offset(1)

' Enters the SW tools
Target.Offset(, 0) = "SW Tools"
Target.Offset(, 2) = Worksheets("SW Tools").Range("B13")




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default help with my code

Have a look in the vba help index for AUTOFIT ie:
columns(2).autofit


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Heather" wrote in message
...
Hi, I am wondering if someone might know of a way to tweak this a little.
You
guys have been so helpful :)

1) I am having trouble with the column widths, each time it's run it
removes
the width, is there a way to set this in the code?
2) Is there a way to have the currency in Column D show up looking like it
does in the other tab (example 14,995) rather than 14995.1
3) When they hit the macro button and it creates this information it needs
to do 2 things 1) dump into Word and 2) clear so it can create the tab
again
with new data?

Any help is always appreciated! -- thank you!

Sub CreateTerm()
Dim ws As Worksheet
Set ws = gettab("TermSummary")
Dim rPart As Range
Dim Target As Range
With ws

' Enters the Currency
.Range("B3") = Worksheets("Planner").Range("A4")
.Range("C3") = Worksheets("Planner").Range("B4")
' Enters the # of Users
.Range("B4") = "Users"
.Range("C4") = Worksheets("Planner").Range("B5")
' Enters the Platform Type
.Range("B5") = "Platform/Edition"
.Range("C5") = Worksheets("Planner").Range("A12")
.Range("D5") = Worksheets("Planner").Range("B12")
' Enters the Addtl part numbers
Set Target = .Range("B6")
End With
Set rPart = Worksheets("Planner").Range("B17")
Do Until rPart = ""
Target.Offset(, 1) = rPart.Offset(, -1).Value
Target.Offset(, 2) = rPart.Offset(, 1)
Set Target = Target.Offset(1)
Set rPart = rPart.Offset(1)
Loop

' Enters the Grand Total Price
Target.Offset(, 0) = "Term Model Total Price"
Target.Offset(, 2) = Worksheets("Planner").Range("TermModel.Price")
Set Target = Target.Offset(1)
Set rPart = rPart.Offset(1)

' Enters the SW tools
Target.Offset(, 0) = "SW Tools"
Target.Offset(, 2) = Worksheets("SW Tools").Range("B13")


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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
How can I modify my code to offset the defined range and repeat theprocedure instead of duplicating my code? [email protected] Excel Programming 4 May 29th 09 10:13 PM
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does ker_01 Excel Programming 6 October 3rd 08 09:45 PM
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. Corey Excel Programming 3 December 11th 06 05:14 AM
Excel code convert to Access code - Concat & eliminate duplicates italia Excel Programming 1 September 12th 06 12:14 AM


All times are GMT +1. The time now is 02:42 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"