LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default are there any VBA consultants left ? - will pay for help

ps. Watch for line wrap.

Dave Peterson wrote:

I don't see anything wrong with your code. I'm gonna guess that it's your data
that doesn't match what you want -- maybe there's an extra space
(leading/trailing) in that field.

You could check it again or write your code to eliminate those extra spaces:

With Worksheets(strSheetName)
For iDSLineCounter = 1 To 20
If Trim(LCase(.Cells(4 + iDSLineCounter, 10).Value)) _
= LCase("Y") Then
' *** Copy Bed Number
.Cells(4 + iDSLineCounter, 1).Copy
Worksheets("Isolation").Cells(5 + iListCounter, 3).PasteSpecial
_
Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=True, Transpose:=False
' *** Copy Patient Name
.Cells(4 + iDSLineCounter, 2).Copy
Worksheets("Isolation").Cells(5 + iListCounter, 4).PasteSpecial
_
Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=True, Transpose:=False
iListCounter = iListCounter + 1
End If
Next iDSLineCounter
end with

(I added trim() and compared using lcase() on both sides of the comparison
operator.)

The with/end with saves some typing and (I think) makes it easier to read.

DonJ_Austin wrote:

Thanks to EVERYONE who reponded. To those who suggested I post more
information here, the issue is not one of syntax. When the code below is
executed, the condition is true (double-checked) but the conditional code is
not run. This same routine (and more) have been working in another place
with only one variable change, and that is been checked for existence and
spelling.

I will be following up with those who provided contact info so I can deliver
the program in question.

For iDSLineCounter = 1 To 20
If Sheets(strSheetName).Cells(4 + iDSLineCounter, 10) = "Y" Or _
Sheets(strSheetName).Cells(4 + iDSLineCounter, 10) = "y" Then

' *** Copy Bed Number
Sheets(strSheetName).Cells(4 + iDSLineCounter, 1).Copy
Sheets("Isolation").Cells(5 + iListCounter, 3).PasteSpecial
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=True, Transpose:=False
' *** Copy Patient Name
Sheets(strSheetName).Cells(4 + iDSLineCounter, 2).Copy
Sheets("Isolation").Cells(5 + iListCounter, 4).PasteSpecial
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=True, Transpose:=False

iListCounter = iListCounter + 1
End If

Next iDSLineCounter

"Rick Rothstein" wrote:

If the "fix" is not too extensive, we might be able to handle it here for
you at no cost. Can you provide more information so we can see what you
actually need?

--
Rick (MVP - Excel)



"DonJ_Austin" wrote in message
...
These forums are great, but I really need some help quickly with something
that I MUST fix. How can I find someone within hours who can help
troubleshoot (Excel 2007 / VBA) for money ?

.


--

Dave Peterson


--

Dave Peterson
 
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
consultants-where? how much?how good? do I need one? [email protected] Excel Discussion (Misc queries) 1 April 3rd 08 12:05 PM
Free Discount Cards Provided By American Consultants Rx [email protected] Excel Discussion (Misc queries) 0 November 2nd 07 05:50 PM
How to make a cell appear in upper left (top left) corner of works jeff Excel Programming 2 March 6th 07 10:14 PM
rates for Excel application development consultants Dave F Excel Discussion (Misc queries) 1 February 8th 07 09:33 PM
How to change the right-to-left worksheet to left-to-right workshe RAMA Excel Discussion (Misc queries) 1 July 4th 05 01:57 PM


All times are GMT +1. The time now is 02:40 PM.

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

About Us

"It's about Microsoft Excel"