Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Programming problem.

I am building a quoting system and A22 has the qty B22 has the description
and C22 has the price. Sometimes B22 has two lines of information and when I
use the code below, then the information that is meant to be inserted ends up
on different lines.

How do I change my code so that it checks the row first to see if there is
anything on that line and if all fields are blank it will then go ahead with
inserting the informaiton or if there is any info in any of the rows it will
offset three rows.

Thanks for your help

Here is the current code:



Range("A22").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(3, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = "1"

Range("B22").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(3, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = "Non PDF File Download"

Range("C22").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(3, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = "$15"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Programming problem.

Dim lngRow as Long, bolEmpty as Boolean, I as Long, wshQUOTE as worksheet

'Note, change the book name and worksheet name below accordingly to your
file.
Set wshQUOTE = Workbooks("Book1.xls").Worksheets("Quote")
lngRow = 22
bolEmpty = False

Do While bolEmpty = False and lngRow < 65537
bolEmpty = True
For I = 1 to 3 Step 1
If VBA.IsEmpty(wshQUOTE.Cells(lngRow,I)) = False then
bolEmpty = False
lngRow = lngRow + 3
Exit For
End If
Next I
Loop

If bolEmpty = False Then
MsgBox "The worksheet is full in columns A - C.",48
Else
wshQUOTE.Cells(lngRow,1).Value2 = 1 'Make sure to have column A
formatted properly
wshQUOTE.Cells(lngRow,2).Value2 = "Non PDF File Download"
wshQUOTE.Cells(lngRow,3).Value2 = 15 'Make sure to have column C
formatted properly
End if

"JonathanW" wrote in message
...
I am building a quoting system and A22 has the qty B22 has the description
and C22 has the price. Sometimes B22 has two lines of information and when
I
use the code below, then the information that is meant to be inserted ends
up
on different lines.

How do I change my code so that it checks the row first to see if there is
anything on that line and if all fields are blank it will then go ahead
with
inserting the informaiton or if there is any info in any of the rows it
will
offset three rows.

Thanks for your help

Here is the current code:



Range("A22").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(3, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = "1"

Range("B22").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(3, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = "Non PDF File Download"

Range("C22").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(3, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = "$15"



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
problem programming outside the startevent [email protected] Excel Programming 0 February 6th 07 12:44 PM
How would I do this programming problem? Brett Smith[_2_] Excel Programming 0 January 18th 06 12:50 AM
Programming the Progress Bar problem Jeff Excel Programming 7 February 2nd 05 12:52 AM
macro programming problem Dave Murto[_2_] Excel Programming 1 January 3rd 04 02:29 AM
Excel programming problem Peter Hansson Excel Programming 2 November 9th 03 03:19 PM


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