Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-26-2008, 02:37 AM
gjfeng@yahoo.com
 
Posts: n/a
Column and Row spacing?

The code below shows:
ColA
Qty1
Qty2
Qty3

can I modify it to show
ColA -ColB-ColC
Qty1
------Qty2
-----------Qty3


Code:
'Sheets("nvT").Range("c" & Columns.Count).End(xlUp)
(2).Resize(, 1).Value = qty

The code below shows:
ColA-ColB-ColC
Qty1-Qty2-Qty3


can I modify it to show:
ColA -ColB-ColC
Qty1
------Qty2
-----------Qty3

Code:
'Worksheets("nvT").Range("IV7", Worksheets("nvT").Cells(7,
Columns.Count).End(xlToLeft))(3).Value = qty
Reply With Quote
  #2 (permalink)  
Old 05-26-2008, 03:04 AM
=?Utf-8?B?U2hhbmVEZXZlbnNoaXJl?=
 
Posts: n/a
RE: Column and Row spacing?

Hi,

You can do this with a spreadsheet formula:
In cell B2 enter: =IF(ROW()=COLUMN(),$A2,"")
Copy the formula down as far as you need and then to the right as far as
necessary.
Then Copy and Paste Values to get rid of the formulas
Finally delete all the entries from A2 down in column A.

--
Cheers,
Shane Devenshire
Microsoft Excel MVP

"gjfeng@yahoo.com" wrote:

> The code below shows:
> ColA
> Qty1
> Qty2
> Qty3
>
> can I modify it to show
> ColA -ColB-ColC
> Qty1
> ------Qty2
> -----------Qty3
>
>
> Code:
> 'Sheets("nvT").Range("c" & Columns.Count).End(xlUp)
> (2).Resize(, 1).Value = qty
>
> The code below shows:
> ColA-ColB-ColC
> Qty1-Qty2-Qty3
>
>
> can I modify it to show:
> ColA -ColB-ColC
> Qty1
> ------Qty2
> -----------Qty3
>
> Code:
> 'Worksheets("nvT").Range("IV7", Worksheets("nvT").Cells(7,
> Columns.Count).End(xlToLeft))(3).Value = qty
>

Reply With Quote
  #3 (permalink)  
Old 05-26-2008, 03:17 AM
therevivalpeople@yahoo.com.sg
 
Posts: n/a
Re: Column and Row spacing?

not that I do not want to use formulas...but since this is a dynamic
database...it'll may reach 10,000+ formulas!
The full code is here:

Code:
Private Sub CommandButton1_Click()

If Sheets("nvT").Range("b1").Value = "" Then
msgbox "The Date Is Empty!"

Else

Dim box1 As Integer
box1 = msgbox("Ok to Update?", 1 + vbInformation, "Clear Confirm")
If box1 = 1 Then

Dim intRow As Integer
intRow = 2

Do While Worksheets("db").Cells(intRow, 2).Value <> ""
If CStr(Worksheets("db").Cells(intRow, 1).Value) =
Sheets("nvT").Range("b1").Value Then

proID = Worksheets("db").Cells(intRow, 6).Value
pro = Worksheets("db").Cells(intRow, 7).Value
Worksheets("nvT").Range("IV5", Worksheets("nvT").Cells(5,
Columns.Count).End(xlToLeft))(3).Value = proID
Worksheets("nvT").Range("IV6", Worksheets("nvT").Cells(6,
Columns.Count).End(xlToLeft))(3).Value = pro
'Iv5 must match the number 5, IV6 must match the number 6,
they determine the row
'the number in (3), 3 leaves 1 empty space inbetween, 4 leaves
2 empty space

cusID = Worksheets("db").Cells(intRow, 5).Value
cus = Worksheets("db").Cells(intRow, 4).Value
Sheets("nvT").Range("a" & Columns.Count).End(xlUp)(2).Resize(,
2).Value = _
Array(cusID, cus)

qty = Worksheets("db").Cells(intRow, 8).Value
'Sheets("nvT").Range("c" & Columns.Count).End(xlUp)
(2).Resize(, 1).Value = qty
'Worksheets("nvT").Range("IV7", Worksheets("nvT").Cells(7,
Columns.Count).End(xlToLeft))(3).Value = qty
End If

intRow = intRow + 1
Loop

Else

End If 'End of Box1
End If 'End of check if empty IF statement

End Sub

Private Sub CommandButton2_Click()

Dim box1 As Integer
box1 = msgbox("Ok to Clear?", 1 + vbExclamation, "Clear Confirm")
If box1 = 1 Then
Worksheets("nvT").Cells.Value = ""
Range("a1").Value = "Order Date"
Range("a2").Value = "Delivery Date"
Range("a3").Value = "Posting Date"
Range("a4").Value = "Unit Price"
Range("a5").Value = "Product ID"
Range("a6").Value = "Product"
Range("c1").Formula = "=IF(B1="""","""",TEXT(WEEKDAY(B1),""ddd""))"

Else

End If


End Sub

Private Sub CommandButton3_Click()
Range("b1").Value = "=TODAY()"
Range("b2").Value = "=TODAY()"
Range("b3").Value = "=TODAY()"
End Sub
Reply With Quote
  #4 (permalink)  
Old 05-26-2008, 03:25 AM
therevivalpeople@yahoo.com.sg
 
Posts: n/a
Re: Column and Row spacing?

the link of the fiel is here: http://www.geocities.com/gjfeng/protoV2.xls

click on the nvT sheet, then click update command button.
Qty values are 3 bag, 2 bag, 11.5Pkt

3 bag is in the yellow box, I need 2 bad and 11.5 Pkt in the yellow
box.


That's really how I wanted it to be.....or is there a better way?

Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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



All times are GMT. The time now is 03:41 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Buy PSP | Buy Anything On eBay | Credit Card | Buy Anything On eBay | Debt Consolidation



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114